设为首页收藏本站

全球主机交流论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: discuz
查看: 359|回复: 0
打印 上一主题 下一主题

http_load & ab 测试tomcat性能的疑问

[复制链接]
  • TA的每日心情
    无聊
    2017-9-11 09:15
  • 签到天数: 224 天

    [LV.7]常住居民III

    跳转到指定楼层
    楼主
    发表于 2016-1-13 13:21:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    关于性能测试,有2个疑问一直困惑了好久, 哪位牛人给解释下啊

    测试用tomcat安装后默认的主页面,

    1. 用不同的工具,测试结果不一样, 同一工具测试的结果有时也不一样
    server 配置: 1核心 1G 内存, tomcat6
    maxthreads,acceptCount 值为默认值,测试结果如下:
    maxthreads+acceptCount  应该代表了能接受的最大并发访问量, 默认为200+100 =300
    按理,应该在300个并发访问的时候, http_load应该不会显示出错才对啊, 结果在180个并发时就出现了错(“bad byte counts”)

    2.  在4核心, 4G内存的server上, 测试到的性能(能接受的最大并发访问量),似乎与1核1G内存的server比,没有太大变化?


    ---------测试输出-----
    [root@i-vyyaz6i1 ~]# http_load -p 180 -s 30 -v uri
    http://121.201.63.133:8080/: byte count wrong
    http://121.201.63.133:8080/: byte count wrong
    1490 fetches, 180 max parallel, 1.1657e+07 bytes, in 30.0001 seconds
    7823.48 mean bytes/connection
    49.6665 fetches/sec, 388566 bytes/sec
    msecs/connect: 197.334 mean, 2201.22 max, 0.42 min
    msecs/first-response: 670.052 mean, 11131.6 max, 0.684 min
    2 bad byte counts   <----180个并发时, http_load显示有错
    HTTP response codes:
      code 200 -- 1488
    [root@i-vyyaz6i1 ~]# cat uri
    http://121.201.63.133:8080/
    [root@i-vyyaz6i1 ~]# ab -c 180 -t 30 http://121.201.63.133:8080/
    This is ApacheBench, Version 2.3 <$Revision: 655654 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/

    Benchmarking 121.201.63.133 (be patient)
    Finished 1488 requests


    Server Software:        Apache-Coyote/1.1
    Server Hostname:        121.201.63.133
    Server Port:            8080

    Document Path:          /
    Document Length:        7834 bytes

    Concurrency Level:      180
    Time taken for tests:   30.041 seconds
    Complete requests:      1488
    Failed requests:        0                     <-----180个并发时, ab显示没有错
    Write errors:           0
    Total transferred:      12965925 bytes
    HTML transferred:       12561092 bytes
    Requests per second:    49.53 [#/sec] (mean)
    Time per request:       3633.994 [ms] (mean)
    Time per request:       20.189 [ms] (mean, across all concurrent requests)
    Transfer rate:          421.49 [Kbytes/sec] received

    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        3  164 219.1    118    1198
    Processing:    70 2585 3988.6    580   26474
    Waiting:        3  854 2488.6    132   15535
    Total:         93 2750 3980.6    796   26515

    Percentage of the requests served within a certain time (ms)
      50%    796
      66%   2789
      75%   3252
      80%   3632
      90%   5433
      95%  16231
      98%  16469
      99%  16523
    100%  26515 (longest request)
    [root@i-vyyaz6i1 ~]#

    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
    收藏收藏
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|小黑屋|Archiver|手机版|中国U网    

    GMT+8, 2024-5-18 17:31 , Processed in 0.072059 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2013 Comsenz Inc.

    快速回复 返回顶部 返回列表