Linux文件句柄数配置

1、单程序句柄数限制

查看配置的句柄数:ulimit -n

 

cat /etc/security/limits.conf

参考配置:

* soft nofile 655360
* hard nofile 655360

 

2、全局句柄数限制

cat /proc/sys/fs/file-max

参考配置:

6815744

 

3、分析句柄数常用命令

(1)统计各进程打开句柄数:lsof -n|awk '{print $2}'|sort|uniq -c|sort -nr

(2)统计各用户打开句柄数:lsof -n|awk '{print $4}'|sort|uniq -c|sort -nr

(3)统计各命令打开句柄数:lsof -n|awk '{print $1}'|sort|uniq -c|sort -nr

 

posted @ 2019-10-16 10:54  嘟神子  阅读(1834)  评论(0编辑  收藏  举报