[Switch] memcached limit key and value key memcached the maximum length and the maximum length Value

Editor: 

memcached is simple restrictions limit key (key) and the item. The maximum key length of 250 characters. The stored data can not accept more than 1MB, because this is the typical maximum value of the slab. Here we can break through the restrictions on key length.
Problem Solving:
modify memcached source file. Memcached.h length defined in the key, the code is:

#define KEY_MAX_LENGTH 250

Replace desired length, for example: 1024

#define KEY_MAX_LENGTH 1024

The default limit value is 1M

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

To add words, add -I 10m parameters can start.

There will be a warning:

WARNING: Setting item max size above 1MB is not recommended!
 Raising this limit increases the minimum memory requirements
 and will decrease your memory efficiency.

Guess you like

Origin www.cnblogs.com/chenyang920/p/11008632.html