Hutchison Too many open files error

ps -ef | grep tomcat view pid

ls / proc / process pid / fd / | wc -l to view the pid number of files currently open

cat / proc / process pid / limits to see the maximum number of open pid file currently open

ulimit -a          system default maximum number of open

 

Second, the solution
1, allow to increase the number of open files - command mode
ulimit -n 2048
so that you can open the current user's maximum allowable number of files is set to 2048, but this method will restore the settings to default after reboot value. 
ulimit -n command non-root users can only be set to 4096. 
You want to set a greater need to be root or sudo privileges.

2, increasing the number of open files allowed - modify the system configuration file
Vim /etc/security/limits.conf  
# added at the end  
* Soft nofile 4096  
* 4096 Hard nofile  
or include only

 * - nofile 8192

Frontmost * for all users, a user can set as desired, e.g.

Soft nofile 8192 Roy  
Roy Hard nofile 8192  
Note "nofile" There are two possible entry restrictions. That is, hard and soft under the item. To modify the maximum number of open files a nice effect, we must set these two restrictions. If you use the "-" character set, the hard and soft settings will also be set.

 

Note: /etc/security/limits.conf actual limit depends on /etc/security/limits.d/20-nproc.conf (not necessarily the file name, directory need to go see) configuration, which means that even if / etc / security / limits.conf set the maximum number of open is 65535,

  And with that /etc/security/limits.d/20-nproc.conf in 4096, and that the end result is still the largest user can only open the 4096 file handles

Guess you like

Origin www.cnblogs.com/sss-justdDoIt/p/11933493.html