Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 791641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:52:13+00:00 2026-05-14T21:52:13+00:00

Memcached has length limitations for keys (250?) and values (roughtly 1MB), as well as

  • 0

Memcached has length limitations for keys (250?) and values (roughtly 1MB), as well as some (to my knowledge) not very well defined character restrictions for keys. What is the best way to work around those in your opinion? I use the Perl API Cache::Memcached.

What I do currently is store a special string for the main key’s value if the original value was too big (“parts:<number>”) and in that case, I store <number> parts with keys named 1+<main key>, 2+<main key> etc.. This seems “OK” (but messy) for some cases, not so good for others and it has the intrinsic problem that some of the parts might be missing at any time (so space is wasted for keeping the others and time is wasted reading them).

As for the key limitations, one could probably implement hashing and store the full key (to work around collisions) in the value, but I haven’t needed to do this yet.

Has anyone come up with a more elegant way, or even a Perl API that handles arbitrary data sizes (and key values) transparently? Has anyone hacked the memcached server to support arbitrary keys/values?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:52:14+00:00Added an answer on May 14, 2026 at 9:52 pm

    The server does already allow you to specify whatever size you want:

    -I            Override the size of each slab page. Adjusts max item size
                  (default: 1mb, min: 1k, max: 128m)
    

    However, most of the time, when people are wanting to cache larger objects, they’re doing something wrong. Do you really need that much data in one cache key? Uncompressed?

    If you have sufficiently large tasks, the benefit of low-latency access is dwarfed by the time it takes you to actually transfer the data. Or you find that tossing everything in the same key means your frontend ends up having to do a lot of work to deserialize a bit of data they want.

    It depends on your needs, and I can’t tell you what’s best for you without knowing more of what you’re doing. If you truly do need something bigger than 1MB, that’s why we added -I, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If Server 1 has both my database and Memcached as well as www.website1.co.uk -
Has anyone experienced memcached limitations in terms of: of objects in cache store -
Has anyone used spring simple memcached? I have not been able to get the
Memcached interface is implemented using a textual protocol. Sometimes it's very useful to be
I'm considering using memcached (at some point) in my application i'm currently developing. Eventually,
I'm creating a page that has some dynamically generated images built from data that
I have a very weird problem, when storing my session in Memcached. From time
I am disappointed with memcached. Working with it has been far from easy. An
I'm looking for a solid MySQL class for Php that has support for memcached
I have installed (or better my host has installed) memcached at my VPS. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.