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
>>本文为下一朵云的原创文章,转载请附上原文出处链接及本声明
>>原文链接地址:nginx报错:socket() failed (24: Too many open files) while connecting to upstream

暂无评论

发表评论

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