Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase Memcached Max Item Size

I'm trying to increase the max item size in my memcached installation.

So far, I have tried editing /etc/memcached.conf adding the line -I 3M followed by restarting memcached.

This WAS working for me, but seems to have reverted overnight. The setting is still there but as an item exceeds 1MB the cache is cleared.

You can see my original issue here Django Memcached Cache Disappears

I have also tried entering the command memcached -I 3m which returns:

WARNING: Setting item max size above 1MB is not recommended!
Raising this limit increases the minimum memory requirements and will decrease your memory efficiency.
can't run as root without the -u switch 

Subsequently running memcached -Iu 3m returns:

Item max size cannot be less than 1024 bytes.

I have no idea what that means as I am trying to increase the max size, not decrease it and 3MB is certainly more then 1024 bytes. I'm really stumped here, all help is appreciated. Thanks.

UPDATE:

After finding the MySQL documentation on memcached I learned that the -u flag works like so memcached -u root -I 3m. This runs (still with the warning above) but then it just hangs. I've been staring at the terminal for about 10 minutes hoping its going to return my prompt but no such luck. PLEASE HELP.

like image 623
apardes Avatar asked Jul 02 '15 21:07

apardes


1 Answers

Try using a "big M", and also don't put the u directly after the -I. Try this:

memcached -I 3M -u
like image 140
Will Avatar answered Sep 23 '22 08:09

Will