Too Many Open files, How Do I Fix This Problem?
Many application such as Oracle database or Apache web server needs this range quite higher. So you can increase the maximum number of open files by setting a new value in kernel variable /proc/sys/fs/file-max as follows (login as the root):
Above command forces the limit to 100000 files. You need to edit /etc/sysctl.conf file and put following line so that after reboot the setting will remain as it is:
Append a config directive as follows:
Save and close the file. Users need to log out and log back in again to changes take effect or just type the following command:
Verify your settings with command:
OR
# sysctl -w fs.file-max=100000Above command forces the limit to 100000 files. You need to edit /etc/sysctl.conf file and put following line so that after reboot the setting will remain as it is:
# vi /etc/sysctl.confAppend a config directive as follows:
fs.file-max = 100000Save and close the file. Users need to log out and log back in again to changes take effect or just type the following command:
# sysctl -pVerify your settings with command:
# cat /proc/sys/fs/file-maxOR
# sysctl fs.file-maxUser Level FD Limits
The above procedure sets system-wide file descriptors (FD) limits. However, you can limit httpd (or any other users) user to specific limits by editing /etc/security/limits.conf file, enter:
Set httpd user soft and hard limits as follows:
Save and close the file. To see limits, enter:
# vi /etc/security/limits.confSet httpd user soft and hard limits as follows:
tomcat soft nofile 10240
tomcat hard nofile 65000Save and close the file. To see limits, enter:
# su - httpd
$ ulimit -Hn
$ ulimit -Sn
Comments