nginx服务器出现如下信息: 解决方法: 星号代表全局,soft为软件,hard为硬件,nofile为这里指可打开文件数。 重启nginx服务器。
[crit] 17221#0: accept4() failed (24: Too many open files)[crit] 17221#0: accept4() failed (24: Too many open files)[crit] 17221#0: accept4() failed (24: Too many open files)[crit] 17221#0: accept4() failed (24: Too many open files)[crit] 17221#0: accept4() failed (24: Too many open files)
原回是nginx进程打开文件数过多
修改/etc/security/limits.conf文件
* soft nofile 10240* hard nofile 10240
root soft nofile 10240root hard nofile 10240nobody soft nofile 10240nobody hard nofile 10240
修改nginx.conf,添加如下代码:
worker_rlimit_nofile 10240;