关于 Nginx 并发连接数
最近在学习使用 nginx , 做一些简单的压力测试时,发现并发连接数最大只能上到 100 多
测试刚开始时的状态 ,
- netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
- CLOSE_WAIT 2
- ESTABLISHED 133
- SYN_RECV 39
然后 SYN_RECV 状态的连接 一直上升
- netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
- CLOSE_WAIT 2
- ESTABLISHED 133
- SYN_RECV 124
就一直持续到 测试完了。
以下是我的配置
- worker_processes 10;
- worker_rlimit_nofile 51200;
- daemon on;
- master_process off;
- error_log /home/test/apps/nginx/logs/nginx-error.log debug;
- pid /tmp/nginx_demo.pid;
- events {
- worker_connections 51200;
- }
- http {
- include /home/test/apps/nginx/conf/mime.types;
- sendfile on;
- keepalive_timeout 65;
- tcp_nodelay on;
- server {
- listen 8100;
- server_name localhost;
- access_log /home/test/apps/nginx/logs/access.log;
- error_log /home/test/apps/nginx/logs/error.log debug;
- location /lottery_image {
- lig "Hi,this is a demo module";
- }
- }
- }
- ~