免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 10225 | 回复: 4
打印 上一主题 下一主题

[Web] 关于 Nginx 并发连接数 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-05-30 21:50 |只看该作者 |倒序浏览
最近在学习使用 nginx , 做一些简单的压力测试时,发现并发连接数最大只能上到 100 多

测试刚开始时的状态 ,
  1. netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
  2. CLOSE_WAIT 2
  3. ESTABLISHED 133
  4. SYN_RECV 39
复制代码
然后  SYN_RECV   状态的连接 一直上升
  1. netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
  2. CLOSE_WAIT 2
  3. ESTABLISHED 133
  4. SYN_RECV 124
复制代码
就一直持续到 测试完了。  

以下是我的配置

  1. worker_processes  10;
  2. worker_rlimit_nofile 51200;
  3. daemon on;
  4. master_process  off;
  5. error_log  /home/test/apps/nginx/logs/nginx-error.log debug;
  6. pid /tmp/nginx_demo.pid;
  7. events {
  8.     worker_connections  51200;
  9. }
  10. http {
  11.     include       /home/test/apps/nginx/conf/mime.types;
  12.     sendfile        on;
  13.     keepalive_timeout  65;
  14.     tcp_nodelay        on;
  15.     server {
  16.         listen   8100;
  17.         server_name  localhost;
  18.         access_log  /home/test/apps/nginx/logs/access.log;
  19.         error_log   /home/test/apps/nginx/logs/error.log debug;
  20.         location /lottery_image {
  21.             lig "Hi,this is a demo module";
  22.         }
  23.     }
  24. }
  25. ~                                                                                                                                   
  26. ~                                                                                                                                   
  27. ~                                                                                                                                   
  28. ~                                                                                                                                   
  29. ~                                                                                                                                   
  30. ~                                                                                                                                   
  31. ~        
复制代码
这个配置参考了网上的教程。

请问有哪里设置得不对吗?  烦请指教。

论坛徽章:
0
2 [报告]
发表于 2010-05-31 09:34 |只看该作者
没看出配置有问题。

你的机器啥配置啊

论坛徽章:
0
3 [报告]
发表于 2010-05-31 10:18 |只看该作者
两颗  model name        : Intel(R) Xeon(R) CPU           E5504  @ 2.00GHz

32G 内存

论坛徽章:
0
4 [报告]
发表于 2010-05-31 13:24 |只看该作者
your problem is not concerned with your hardware of computer.try to do the following.

first check whether there is tcp limit  on your system.

second check your access warn or error log of nginx.

论坛徽章:
0
5 [报告]
发表于 2010-06-01 17:36 |只看该作者
今天 照着   这篇  << nginx 优化(突破十万并发) >>
http://www.zhlinux.com/190/

做了不少参数 修改,  可以最后 连接 数  还是上不去,
  1. netstat -n |awk '/^tcp/ {++S[$NF] } END {for(a in S) print a, S[a]}'
  2. TIME_WAIT 2
  3. CLOSE_WAIT 2
  4. ESTABLISHED 133
  5. SYN_RECV 5
复制代码
另外,   这个 nginx 我是用来 测试 我写的 nginx module 的性能的,  并没有直接 连数据库, 也没有 跑 php
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP