统计当前进程打开文件数
[...]# lsof -p PID | wc -l
查看当前系统最大文件数
[...]# 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) 3878
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 100001
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) 3878
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
open files (-n) 100001
查看/etc/security/limits.conf
# End of file
* soft nofile 100001
* hard nofile 100002
root soft nofile 100001
root hard nofile 100002
查看/etc/security/limits.d/20-nproc.conf
#* soft nproc 4096
#root soft nproc unlimited
查看当前进程的 limits文件:
cat /proc/PID/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 3878 3878 processes
Max open files 51200 51200 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 3878 3878 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited u
Max open files 51200 51200 files
修改文件描述符数值:
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
然后重新登陆,输入ulimit -a命令查询。
本文转载自:https://zhangchen.cc/?id=14
» 本文链接地址:https://blog.mydns.vip/3585.html
最新评论
我的站目前每天120个IP,其中刷的是100个。 不知道为什么升级到4H8G5M的标准服务器还是偶尔会崩,CPU占满,但是内存一般这种时候只占50%左右,这是为什么呢?max_children我也设
麻烦发下检测工具
让我下载