Increasing max open files limit on Ubuntu

To ensure good server performance, the total number of client connections, database files, and log files must not exceed the maximum file descriptor limit on the operating system (ulimit -n). Linux systems limit the number of file descriptors that any one process may open to 1024 per process.

Edit /etc/security/limits.conf and add these lines to the end of the file

root hard nofile 32000
root soft nofile 32000

Replace root with the desired username. The file describes what these parameters mean. Now edit “/etc/pam.d/common-session” and “/etc/pam.d/common-session-noninteractive” and add the below line at the end of both these files.

session required pam_limits.so

Now run ulimit -n to see if the changes have taken place.

References:

1. http://askubuntu.com/questions/162229/how-do-i-increase-the-open-files-limit-for-a-non-root-user