apardes
apardes

Reputation: 4380

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.

Upvotes: 8

Views: 7008

Answers (2)

Max Nanasy
Max Nanasy

Reputation: 6141

1.

This runs (still with the warning above) but then it just hangs.

memcached is supposed to hang. It's waiting for requests to come in on port 11211 (which is the default if you don't specify otherwise). Use the -d flag if you want it to run without monopolizing your terminal.

2. Why are you running as root? That seems unnecessarily privileged for an in-memory cache, unless you need to listen on a port under 1024, which you're not doing with your current command line.

Upvotes: 0

Will
Will

Reputation: 24699

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

memcached -I 3M -u

Upvotes: 2

Related Questions