Configuring MAXITEMSIZE in memcached in gentoo

gentoomemcached

Got memcached up and running (emerged net-misc/memcached) but on PHP I'm getting

Server 127.0.0.1 (tcp 35817, udp 0) failed with: SERVER_ERROR object too large for cache

I'm thus trying to change the MAXITEMSIZE variable to allow for bigger variables (I am saving a few ones bigger than 1MB)

and tried to edit /etc/conf.d/memcached with adding the following (both options just in case):

MAXITEMSIZE="1234567"
item_size_max="1234567"

but to no avail. Even though changing other variables in that file and restarting memcached does show when I do:

echo "stats settings" | nc localhost 112211

This one refuses to be set.

What am I missing?

Is there a documentation on installing a cluster of servers on gentoo?

Thanks

Best Answer

Changing this option should be with the -I parameter passed to the daemon. So in the same /etc/conf.d/memcached I changed

# Other Options
MISC_OPTS=""

to 128M this way:

# Other Options
MISC_OPTS="-I 128M"

Of course you can choose your own block size. Now restarting the daemon shows a warning

/etc/init.d/memcached restart * Caching service dependencies ...
[ ok ] * Stopping memcached ...
[ ok ] * Starting memcached ... WARNING: Setting item max size above 1MB is not recommended! Raising this limit increases the minimum memory requirements and will decrease your memory efficiency.