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