Increase the maximum size of a Memcached item

I am trying to increase the maximum item size in my memcached installation.

So far, I have tried editing /etc/memcached.conf

by adding a line -I 3M

followed by a memcached restart.

This works for me, but seems to be back overnight. This parameter still exists, but since the item is larger than 1 MB, the cache is cleared.

You can see my original problem here Fixed Django Memcached Caching

I have also tried entering a command memcached -I 3m

that 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, the launch memcached -Iu 3m

returns:

Item max size cannot be less than 1024 bytes.

      

I have no idea what this means when I try to increase the maximum size rather than decrease it, and 3 MB is of course over 1024 bytes. I'm actually dumb here, all help is appreciated. Thank.

UPDATE:

After searching MySQL documentation on memcached, I found out that the -u flag works like this memcached -u root -I 3m

. This gets executed (still with the warning above), but then it just hangs. I stared at the terminal for about 10 minutes, hoping it would return a prompt to me, but that kind of luck won't happen. PLEASE HELP.

+3


source to share


2 answers


Try using the "big M" and also don't put it u

directly after -I

. Try the following:



memcached -I 3M -u

      

0


source


1.

This gets executed (still with the warning above), but then it just hangs.



Memcached is supposed to hang. It expects requests to arrive on port 11211 (which is the default, unless you specify otherwise). Use a flag -d

if you want it to run without monopolizing your terminal.

2. Why are you using root? This seems overly privileged for in-memory cache unless you need to listen on a port under 1024, which you don't with the current command line.

0


source







All Articles