linux系統檔案開啟數

jiftle發表於2024-11-14

檢視總的檔案開啟數

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

相關文章