nginx.conf
(原文链接 http://ddbiz.com/?p=153)
events {
use epoll;
worker_connections 8192;
}
增加 worker_connections,测试配置报告:
[warn]: 8192 worker_connections are more than open file resource limit: 1024
这需要调整系统的文件描述符 nofile
open file resource limit 是linux中process可以打开的文件句柄数量。增加这个数值需要调整两个配置:
第一步, 修改系统最大允许的文件描述符
查看当前的设置:
$ cat /proc/sys/fs/file-max
2390251
或者
$ sysctl -a
fs.file-max = 2390251
该系统是CentOS 5.x x64版本,安装好后没有做过优化设定, 2390251是其默认值
$ ulimit -n
1024
如果 /proc/sys/fs/file-max小于我们要设定的句柄数量,可以通过: