nginx压力测试的并发问题
本帖最后由 tevoo2 于 2010-10-28 14:54 编辑服务器配置:Dell R710, 8G内存, ubuntu 10.10。
压力测试的页面是 index.html ,该文件值包含了"Hello World!"
500的并发: http_load -f 10000 -p 500 urllist.txt
结果:
10000 fetches, 500 max parallel, 220000 bytes, in 0.693075 seconds
22 mean bytes/connection
14428.5 fetches/sec, 317426 bytes/sec
msecs/connect: 0.4445 mean, 4.755 max, 0.143 min
msecs/first-response: 33.1882 mean, 35.305 max, 0.427 min
HTTP response codes:
600的并发:http_load -f 10000 -p 600 urllist.txt
10000 fetches, 600 max parallel, 220000 bytes, in 3.12906 seconds
22 mean bytes/connection
3195.85 fetches/sec, 70308.6 bytes/sec
msecs/connect: 14.6379 mean, 3009.82 max, 0.141 min
msecs/first-response: 45.6007 mean, 3007.76 max, 0.436 min
HTTP response codes:
code 200 -- 10000
并发数就差100,为什么结果就差这么远?这个瓶颈会出在哪里?
我的nginx的大致配置是:worker_processes4;
worker_cpu_affinity 0001 0010 0100 1000;
worker_rlimit_nofile 102400;
events {
use epoll;
worker_connections102400;
}/etc/security/limits.conf的配置:* soft nofile 102400
* hard nofile 102400/etc/sysctl.conf的配置net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.ip_local_port_range = 1024 65000 性能下降如此快,就表示你遇到了"拐头"!
性能压力测试的"拐头"这个词你可以去网上找找.应该有介绍!
捌头的出现.不仅仅是nginx配置的问题!
还涉及到其它的瓶颈!
network
io
memory
cpu
自己测试的时间要长30分钟以上吧!同时做好性能的实时监控!再发现问题! 前后两次测试的时候.硬件性能,最好能自己划个画表.然后先后对比!是那部分出现了性能问题导致的. 哥们,你这问题解决了没?我也遇到了
页:
[1]