调整Linux最大文件打开数


1、编辑/etc/security/limit.conf 最后一行增加如下内容

  *   soft   nofile    65535

       *   hard  nofile    65535

 

2、在 /etc/rc.local 中添加

      ulimit -SHn  65535

 

备注:如查看nginx应用的最大文件打开数脚本

    for pid in `ps -ax | grep nginx | grep -v grep | awk '{print $2}'`

    do

      cat /proc/${pid}/limits | grep 'Max open files'

    done

 


免责声明!

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



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