nginx报错:socket() failed (24: Too many open files) while connecting to upstream

文章
nginx报错:socket() failed (24: Too many open files) while connecting to upstream-下一朵云

nginx反代新项目,在线人数过多时就会报错,查看日志,报错如下:

socket() failed (24: Too many open files) while connecting to upstream

解决办法

1.修改linux打开文件句柄数,编辑/etc/security/limits.conf,添加

*             soft   nofile          204800
*             hard   nofile          204800

2.修改nginx打开文件数, 编辑nginx.conf,添加worker_rlimit_nofile值

worker_processes  1;
 worker_rlimit_nofile 20480;

3.重启nginx后解决

./nginx -s stop 
./nginx
版权声明:本文为下一朵云发布文章,转载请附上原文出处链接和本声明。
本文链接:https://www.orcy.net.cn/1827.html

​ 广告:HCIE-Security认证课程辅导资料(付费)

暂无评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注