david-sorber
February 26th, 2016, 04:52 PM
I have a sever process (that runs as root) on Ubuntu 14.04.3 that sometimes needs to open several thousand files. By default the max "soft" limit appears to be 1024 and the "hard" max appears to be 4096.
I have attempted to follow the instructions from here but nothing has worked:
http://askubuntu.com/questions/162229/how-do-i-increase-the-open-files-limit-for-a-non-root-user
http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/
http://posidev.com/blog/2009/06/04/set-ulimit-parameters-on-ubuntu/
Here is what I've done specifically:
Edited /etc/sysctl.conf and added this at the bottom:
fs.file-max = 8192
Edited /etc/security/limits.conf and added this at the bottom:
root hard nofiles 8192
root soft nofiles 8192
Edited /etc/pam.d/common-session and /etc/pam.d/common-session-interactive and added this to the bottom:
session required pam_limits.so
Reboot.
After reboot:
user@system:~$ sudo su
[sudo] password for user:
root@system:/home/user# ulimit -Sn
1024
root@system:/home/user# ulimit -Hn
4096
Clearly my attempt to increase the limit to 8192 has not "taken". I'm stuck on this any help would be greatly appreciated.
I have attempted to follow the instructions from here but nothing has worked:
http://askubuntu.com/questions/162229/how-do-i-increase-the-open-files-limit-for-a-non-root-user
http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/
http://posidev.com/blog/2009/06/04/set-ulimit-parameters-on-ubuntu/
Here is what I've done specifically:
Edited /etc/sysctl.conf and added this at the bottom:
fs.file-max = 8192
Edited /etc/security/limits.conf and added this at the bottom:
root hard nofiles 8192
root soft nofiles 8192
Edited /etc/pam.d/common-session and /etc/pam.d/common-session-interactive and added this to the bottom:
session required pam_limits.so
Reboot.
After reboot:
user@system:~$ sudo su
[sudo] password for user:
root@system:/home/user# ulimit -Sn
1024
root@system:/home/user# ulimit -Hn
4096
Clearly my attempt to increase the limit to 8192 has not "taken". I'm stuck on this any help would be greatly appreciated.