Trouble increaseing file descriptor limits (Ubuntu 10.04)
I'm stuck trying to increase my allowed file descriptors on Ubuntu 10.04. Searching the internet yields dozens of different instruction sets - I'm not sure which applies to my setup, and further, the three that I've tried have not worked.
I have tried:
simply doing 'ulimit -n 65536'
adding 'soft nofile 65536' 'hard nofile 65536' to /etc/security/limits.conf, uncommenting, 'session required pam_limits.so' from /etc/pam.d/su and rebooting
Adding 'fs.file-max = 65536' to /etc/sysctl.conf, then running 'sysctl -p'
All get me nowhere. I'm running Apache / PyMongo – without restarting Apache periodically Mongo is running out of file descriptors and crashing.
Any tips?
Thanks
1 Reply
1) The second method I described, actually works - but I was running as root and the rule "* soft nofile 65536" does not apply to root. Adding additional rules for root "root soft nofile 65536", "root hard nofile 65536" to /etc/security/limits.conf showed the change. Reboot was not required. Changing the limits for root wasn't strictly necessary for the problem I was having, but then it turns out, changing the limits at all wasn't required…..
2) The problem I was actually experiencing of mongo crashing due to lack of file descriptors was caused by bug is PyMongo 2.2. File descriptors were never being closed, so the crash is inevitable with enough time. See here: