1. What is the maximum length of the key value ?
The maximum length of the memcached key is more than one character and is the limit of the memcached server.
If you are using a client that supports "key prefixes" or similar features, then the maximum length of key (prefix + original key) can be more than 250 characters.
We recommend using shorter keys because you can save memory and bandwidth. Key as long as not repeating on the line, if too big waste memory.
To modify the key size:
Modify the memcached source file. Define the length of the key in memcached.h with the following code:
#define Key_max_length 250
2.key cannot have spaces and control characters
The key must not include control characters or whitespace.
3. For Item the expiration time limit ?
The expiration time is maximum .
If you do not pay attention to this detail, the Expiration time setting is greater than 30 days, the value will not be set into the cache
4. How large a single can be stored item?
1MB, because this is the maximum value of a typical slab .
If your data is larger than 1MB, consider compressing or splitting the client into multiple keys.
Can be modified with the-l option:
-L OVERRIDE the size of each slab page. Adjusts max item size. (DEFAULT:1MB, min:1k, max:128m)
To add, you can start by adding the-I 10m parameter.
There will be a warning:
Warning:setting Item Max size above 1MB is not recommended!
Raising this limit increases the minimum memory requirements
And would decrease your memory efficiency.
memcached key,value, Expiration time limit