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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM