How to increase the amount of memory memcache uses?

I use Ubuntu, and Debian mostly, so this answer is based on those, but I suspect the answer for other distros is largely the same.

In /etc/memcached.conf — If it’s not in exactly the same place, a) I’d be surprised, and b) you could find it with locate

# Start with a cap of 64 megs of memory. It's reasonable, and the daemon default
# Note that the daemon will grow to this size, but does not start out holding this much
# memory
-m 64

So all you need do, is change the -m 64 line to

-m 4096

Or similarly large value in Megabytes.

There’s some other yummy tuning parameters in there, such as the user it runs as, and what to do when it runs out of memory, and the IP address to bind the daemon to.. Have a look for yourself.

Leave a Comment