Friday, September 05, 2008

Too many open files - change ulimit values in Ubuntu 8.04 (Hardy Heron)

1) Add line
* hard nofile 51200

to /etc/security/limits.conf

Note:
The * means every user except root
Note: 51200 represents the number of concurrent open files. This number must by a multiple of 1024

2) Add line
session required pam_limits.so

to /etc/pam.d/common-session

3) Stop all processes that need the new limit

4) Restart SSH server

5) Login again

6) Run ulimit -a to check the values

7) If the values haven't changed, reboot and try step 6 again

8) Start new processes from command line

1 comment:

Shlomo said...

Most other tips about increasing the limit only mention ulimit but leave out the pam steps.

This one actually works!

Thanks!