Linux adjust the maximum number of open files

1, edit /etc/security/limit.conf last line to add the following

  * Soft nofile 65535

       * Hard nofile 65535

 

2, add in /etc/rc.local

      ulimit -SHn  65535

 

Note: nginx applications such as viewing the maximum number of open files script

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

    do

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

    done

 

Guess you like

Origin www.cnblogs.com/wuhengood/p/11275670.html