Using ulimit -n i am able to set per shell based maximum open files limit
To make this value persistent i am able to edit this is in /etc/security/limits.conf and restart the ubuntu 12.10 box, here is the configuration
* soft nofile 10240
* hard nofile 10240
root soft nofile 10240
root hard nofile 10240but the above value is not getting applied to memcached service, how to make "max open files 10240" to memcached service.
even after setting limits.conf the memcached is still showing
xx@xx:~$ ps aux|grep mem
mysql 2044 0.0 0.0 327436 1260 ? Sl 17:09 0:00 /usr/bin/memcached -vv -m 256 -p 11211 -u mysql -l 0.0.0.0
xx@xx:~$ cat /proc/2044/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 30402 30402 processes
Max open files 1024 1024 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 30402 30402 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited usplease let me know how to increase "max open files" for memcached service
12 Answers
In the memcache config set the max open connections using:
-c 10240You can check if this is actually necessary or not by checking on listen_disabled_num when running:
echo stats | nc localhost 11211You should see that value above 0 if max connections are an issue.
It seems memcached process is started by mysql user. Try to explicitly add rules in limits.conf to this user (* should apply to all users except root, but it doesn't cost much to try...).
mysql soft nofile 10240
mysql hard nofile 10240Also I think those limits are only applied if PAM loads them. Check if you have the following line in /etc/pam.d/common-session
session required pam_limits.soIf not add it at the end. After this you may need to reboot to see the changes applied.
2