免费注册 查看新帖 |

Chinaunix

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

nginx压力测试的并发问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-10-28 14:53 |只看该作者 |倒序浏览
本帖最后由 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的大致配置是:
  1. worker_processes  4;
  2. worker_cpu_affinity 0001 0010 0100 1000;
  3. worker_rlimit_nofile 102400;
  4. events {
  5.     use epoll;
  6.     worker_connections  102400;
  7. }
复制代码
/etc/security/limits.conf的配置:
  1. * soft nofile 102400
  2. * hard nofile 102400
复制代码
/etc/sysctl.conf的配置
  1. net.ipv4.ip_forward = 0
  2. net.ipv4.conf.default.rp_filter = 1
  3. net.ipv4.conf.default.accept_source_route = 0
  4. kernel.sysrq = 0
  5. kernel.core_uses_pid = 1
  6. net.ipv4.tcp_syncookies = 1
  7. kernel.msgmnb = 65536
  8. kernel.msgmax = 65536
  9. kernel.shmmax = 68719476736
  10. kernel.shmall = 4294967296
  11. net.ipv4.tcp_max_tw_buckets = 6000
  12. net.ipv4.tcp_sack = 1
  13. net.ipv4.tcp_window_scaling = 1
  14. net.ipv4.tcp_rmem = 4096        87380   4194304
  15. net.ipv4.tcp_wmem = 4096        16384   4194304
  16. net.core.wmem_default = 8388608
  17. net.core.rmem_default = 8388608
  18. net.core.rmem_max = 16777216
  19. net.core.wmem_max = 16777216
  20. net.core.netdev_max_backlog = 262144
  21. net.core.somaxconn = 262144
  22. net.ipv4.tcp_max_orphans = 3276800
  23. net.ipv4.tcp_max_syn_backlog = 262144
  24. net.ipv4.tcp_timestamps = 0
  25. net.ipv4.tcp_synack_retries = 1
  26. net.ipv4.tcp_syn_retries = 1
  27. net.ipv4.tcp_tw_recycle = 1
  28. net.ipv4.tcp_tw_reuse = 1
  29. net.ipv4.tcp_mem = 94500000 915000000 927000000
  30. net.ipv4.tcp_fin_timeout = 1
  31. net.ipv4.tcp_keepalive_time = 30
  32. net.ipv4.ip_local_port_range = 1024    65000
复制代码

论坛徽章:
0
2 [报告]
发表于 2010-11-02 11:22 |只看该作者
性能下降如此快,就表示你遇到了"拐头"!

性能压力测试的"拐头"这个词你可以去网上找找.应该有介绍!


捌头的出现.不仅仅是nginx配置的问题!
还涉及到其它的瓶颈!

network
io
memory
cpu

自己测试的时间要长30分钟以上吧!同时做好性能的实时监控!再发现问题!

论坛徽章:
0
3 [报告]
发表于 2010-11-02 11:24 |只看该作者
前后两次测试的时候.硬件性能,最好能自己划个画表.然后先后对比!是那部分出现了性能问题导致的.

论坛徽章:
3
CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52
4 [报告]
发表于 2013-10-30 14:58 |只看该作者
哥们,你这问题解决了没?我也遇到了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP