Too many open files
The reason for this is that the number of file/socket connections that the program opens exceeds the system setting.
To view the maximum allowable number of open files per user
Ulimit-a
fdipzone@ubuntu:~$ ulimit-a
Core file size (blocks,-c) 0
data seg size (Kbytes,-D) Unlimited
Scheduling Priority (-E)
file size (blocks,-f) Unlimited pending signals (-I ) 16382
Max Locked Memory (Kbytes, L)
max memory size (Kbytes, m) Unlimited
open files (- N) 1024
Pipe Size (bytes, p) 8
POSIX message Queues (bytes,-q) 819200
real-time Priority (-R) 0
stack size< c24/> (Kbytes,-s) 8192
CPU time (seconds,-T) unlimited
max User Processes (-u) Unlimited
Virtual Memory (Kbytes,-V) unlimited
file Locks (-X) Unlimited
where open files (-N) 1024 indicates that the maximum number of files allowed for each user is 1024
View the number of files currently open on the system
lsof | Wc-l
Watch "lsof | Wc-l "
View the number of open files for a process
Lsof-p PID | Wc-l
lsof-p 1234 | wc-l
Set the open files numeric method
Ulimit-n 2048
fdipzone@ubuntu:~$ ulimit-n 2048
fdipzone@ubuntu:~$ ulimit-a
core file size (blocks,-c) 0
data seg siz E (Kbytes,-D) unlimited
scheduling priority (-E)
file size (blocks,-f) Unlimited
Pending Signals (i) 16382
max locked Memory (Kbytes,- L)
max memory size (Kbytes, M) Unlimited
open Files (-N) 2048
pipe Size (bytes, p) 8
POSIX message Queues (bytes,- Q) 819200
real-time Priority (-R) 0
stack size (Kbytes,-s) 8192
CPU time (seconds,-t) Unlimited
max User Processes (-u) unlimited
virtual memory (Kbytes,-V) unlimited
file locks (x) Unlimited
This sets the maximum allowable number of open files for the current user to 2048, but this setting is restored to the default value after the reboot.
Permanent Settings method
Vim/etc/security/limits.conf
in the last addition
* Soft nofile 4096
* Hard nofile 4096
The top * represents all users and can set a user as needed, such as
Fdipzone soft nofile 8192
fdipzone hard Nofile 8192
After the change, the cancellation will be effective.
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/