+ -
当前位置:首页 → 问答吧 → 关于 Nginx 并发连接数

关于 Nginx 并发连接数

时间:2010-05-30

来源:互联网

最近在学习使用 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. ~        
复制代码
这个配置参考了网上的教程。

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

作者: free4machine   发布时间: 2010-05-30

没看出配置有问题。

你的机器啥配置啊

作者: maochanglu   发布时间: 2010-05-31

两颗  model name        : Intel(R) Xeon(R) CPU           E5504  @ 2.00GHz

32G 内存

作者: free4machine   发布时间: 2010-05-31

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.

作者: todayhero   发布时间: 2010-05-31

热门下载

更多