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
