一个和worker_connections参数相关的Nginx系统问题及解决办法
来源:互联网 发布:linux本地socket 编辑:程序博客网 时间:2024/05/19 17:27
1. 问题现象
nginx运行过程中,发现无法访问nginx(导致nagios监控告警) ,且error日志中一直报如下错误
2011/05/10 16:31:07 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:07 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:07 [alert] 24085#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:07 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:07 [alert] 24085#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:08 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:08 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:08 [alert] 24085#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:08 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2.初步原因分析
目前nginx 中worker_connections 值设置是1024,worker_processes 值设置是4,按反向代理模式下最大连接数的理论计算公式:
最大连接数 = worker_processes * worker_connections/4
算出目前每台nginx理论上只支持1024个。但观察NGINX 历史性能数据,发现活动连接数经常是大于1024,并且最高达到5000左右,因而有时会导致连接数不够,直到NGINX无法再处理新的连接请求。
3.解决办法
查看相关资料,生产环境中worker_connections 建议值最好超过9000,计划将一台nginx 设置为10240,再观察一段时间。
nginx运行过程中,发现无法访问nginx(导致nagios监控告警) ,且error日志中一直报如下错误
2011/05/10 16:31:07 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:07 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:07 [alert] 24085#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:07 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:07 [alert] 24085#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:08 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:08 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:08 [alert] 24085#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2011/05/10 16:31:08 [alert] 24082#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:81
2.初步原因分析
目前nginx 中worker_connections 值设置是1024,worker_processes 值设置是4,按反向代理模式下最大连接数的理论计算公式:
最大连接数 = worker_processes * worker_connections/4
算出目前每台nginx理论上只支持1024个。但观察NGINX 历史性能数据,发现活动连接数经常是大于1024,并且最高达到5000左右,因而有时会导致连接数不够,直到NGINX无法再处理新的连接请求。
3.解决办法
查看相关资料,生产环境中worker_connections 建议值最好超过9000,计划将一台nginx 设置为10240,再观察一段时间。
- 一个和worker_connections参数相关的Nginx系统问题及解决办法
- Nginx中worker_connections的问题
- Nginx中worker_connections的问题
- Nginx中worker_connections的问题
- nginx中关于并发数的问题worker_connections,worker_processes
- 相关问题及解决办法
- [Nginx]并发数问题思考:worker_connections,worker_processes与 max clients
- nginx 并发数问题思考:worker_connections,worker_processes与 max clients
- nginx之worker_connections
- nginx最大并发连接数的思考:worker_processes、worker_connections、worker_rlimit_nofile
- nginx最大并发连接数的思考:worker_processes、worker_connections、worker_rlimit_nofile
- C函数库qsort函数及最后一个参数的相关问题
- 最近做的一个linux下的聊天系统,遇到的一些问题及解决办法
- nginx 优化系列之worker_connections
- nginx 优化系列之worker_connections
- nginx 优化系列之worker_connections
- 【nginx】优化系列之worker_connections
- Nginx系列—修改Nginx进程最大可打开文件数(worker_processes和worker_connections)
- Spring的JDBCTemplate
- 整合apache+php(把php做为apache模块整合)
- AcdbTable 例子学习笔记
- AdRotator
- 七秘诀工作效率与薪水翻番
- 一个和worker_connections参数相关的Nginx系统问题及解决办法
- close_wait状态和time_wait状态
- 使用cxf 发布 jax-rs 风格webservice 。并客户端测试。
- ios中复杂实体类对象的json序列化
- 优化的内存访问 TCMalloc
- 增加最大 TCP/IP 可用端口数
- MS INET控件在Debug下的断言错误
- Ubuntu下如何修改文件的属性
- Impala介绍博客相关问答