How to allocate memory to memcached

bitnamimemcachedmemoryubuntu-14.04

I need to allocate memory to memcached.
I executed following command

sudo find / -name memcached.conf

and it returned a single file located at /opt/bitnami/common/etc/memcached.conf and it contains following content

mech_list: plain
log_level: 5
sasldb_path: /opt/bitnami/common/etc/sasldb2

And

ps aux | grep '[m]emcached'

gives following output

memcach+ 20227  0.0  0.0 329828  1164 ?        Ssl  Jan20   0:00 /opt/bitnami/memcached/bin/.memcached.bin -l 127.0.0.1 -p 11211 -P /opt/bitnami/memcached/tmp/memcached.pid -u memcached -d

I don't know how much ram is set as default, I need to allocate more memory to it and set other configs. I've found links which suggest to use option -m to allocate memory but I'm seeing any such config files in my system.

Best Answer

By default 64MB is allocated. You can increase it using the -m option. For example, to increase it to 128MB add it in the memcached.conf as below in a new line and restart memcached:

-m 128

Check: Using memcached and Memcached Installation and Configuration with PHP on Debian server