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服務器。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM