Today, there is a server in the system exception, and sometimes even simple shell commands can not be executed, a variety of strange errors, and sometimes successfully executed
Such as:
-bash:error while loading shared libraries:libncurses.so.5:cannot open Shared object File:error 23
-bash:/etc/profile:too Many open files in system
View the number of open files allowed by the current operating system
Ulimit-n
The discovery is set to 163840, the execution lsof|wc-l command is 65528, and the value set is still a big gap, why also reported too many open files, suddenly remembered there is a place to set the maximum number of files
Using commands
Cat/proc/sys/fs/file-max
65536, this time know why there are occasional anomalies, the current system uses the number of files and the maximum number of close
echo 131072 >/proc/sys/fs/file-max increases directly by one-fold, which can take effect immediately, but fails if the operating system restarts
If you need to permanently take effect, Modify the/etc/sysctl.conf file, followed by Fs.file-max = 131072, the execution sysctl-p takes effect
So when there are too many open files in the system, there are 2 places to look at.
Problem solving.
Linux News too many open files solution