查看总的文件打开数
lsof
查看占用文件打开数最多的10个进制
lsof | awk '{print $2}' | sort | uniq -c | sort -nr | head -n 10
# lsof | awk '{print $2}' | sort | uniq -c | sort -nr | head -n 10
31171 10428
11398 1006
10761 1005
3836 1004
3500 2144
912 1510
576 1362
494 1620
475 1002
324 2106
查看系统的文件打开数限制
ulimit -a
# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 62332
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 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) 62332
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited