nginx accept() failed (24: Too many open files)
转载
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
星号代表全局,soft为软件,hard为硬件,nofile为这里指可打开文件数。
root soft nofile 10240
root hard nofile 10240
nobody soft nofile 10240
nobody hard nofile 10240
修改nginx.conf,添加如下代码:
worker_rlimit_nofile 10240;
重启nginx服务器。
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。