nginx压力测试的并发问题
时间:2010-10-28
来源:互联网
本帖最后由 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的大致配置是:
复制代码
/etc/security/limits.conf的配置:
复制代码
/etc/sysctl.conf的配置
复制代码
服务器配置: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_processes 4;
- worker_cpu_affinity 0001 0010 0100 1000;
- worker_rlimit_nofile 102400;
- events {
- use epoll;
- worker_connections 102400;
- }
- * soft nofile 102400
- * hard nofile 102400
- 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
作者: tevoo2 发布时间: 2010-10-28
性能下降如此快,就表示你遇到了"拐头"!
性能压力测试的"拐头"这个词你可以去网上找找.应该有介绍!
捌头的出现.不仅仅是nginx配置的问题!
还涉及到其它的瓶颈!
network
io
memory
cpu
自己测试的时间要长30分钟以上吧!同时做好性能的实时监控!再发现问题!
性能压力测试的"拐头"这个词你可以去网上找找.应该有介绍!
捌头的出现.不仅仅是nginx配置的问题!
还涉及到其它的瓶颈!
network
io
memory
cpu
自己测试的时间要长30分钟以上吧!同时做好性能的实时监控!再发现问题!
作者: todayhero 发布时间: 2010-11-02
前后两次测试的时候.硬件性能,最好能自己划个画表.然后先后对比!是那部分出现了性能问题导致的.
作者: todayhero 发布时间: 2010-11-02
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28