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 10240 root hard nofile 10240 nobody soft nofile 10240 nobody hard nofile 10240
修改nginx.conf,添加如下代码:
worker_rlimit_nofile 10240;
版权声明:博主文章,可以不经博主允许随意转载,随意修改,知识是用来传播的。