By default number of open files per user in Ubuntu are 1024.
Use following command to check number of open files:
$ ulimit -n
Output:
1024
To increase number of open files add following lines in /etc/security/limits.conf :
@userName soft nofile 65535 @userName hard nofile 65535
where, userName is for which user (username) you want to increase the number of open files.
65535 is maximum number of files we can open in any Linux operating system, the number should not exceed 65535.
Next add following line in /etc/pam.d/common-session file.
session required pam_limits.so
After updating both files reboot your server/desktop and check for ulimit again with ulimit -n, it should be 65535.
-Sany
The first command should be:
ulimit -n
Thanks, Updated the command.