赞
踩
failed (24: Too many open files) while connecting to upstream
2021/06/28 14:18:09 [alert] 6672#0: *18115339 socket( ) failed (24: Too many open files) while connecting to upstream, client: 112.135.41.158, server: acs.peotv.com, request: "POST /acs HTTP/1.1", upstream: "http://172.17.225.41:8080/acs", host: "acs.peotv.com:443"
查看nginx日志,出现open files 的限制,意味着nginx上面的进程连接数不够导致的,于是在nginx配置中增加最大打开的进程数,文件句柄数等
查看文件句柄数(最大打开文件数): #ulimit -a : open files 默认1024
可修改默认设置: # ulimit -n 204800 最大值为655350
修改linux打开文件句柄数,编辑vi /etc/security/limits.conf,添加
* soft nofile 65535
* hard nofile 65535
* soft nproc 65535
* hard nproc 65535
worker_rlimit_nofile 20480;
重启nginx后问题修复完成
创作者:吴仔汕
欢迎大家参考,还可以提出疑问或者不同看法噢。
原创作品,转载请标明出处!!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。