设为首页 收藏本站
查看: 875|回复: 0

[经验分享] tomcat AB测试结果分析

[复制链接]
YunVN网友  发表于 2018-12-3 14:14:28 |阅读模式
  AB测试,200个请求,20个并发.这样的测试强度,CPU占了70-80%,w3p占用了70多M内存,本想多测几次,看看它的内存会不会涨上去,没 有测试机器没办法,开发机要干活.我估计CPU就有问题了,性能有好些个地方还需要优化.
  

  顺便把测试的工具用法作个记号
  

  基本用法:
  ab -n 全部请求数 -c 并发数 测试url
  例:ab -n 1000 -c 50 http://www.newdev.gztest.com/
  Server Software:         Microsoft-IIS/7.0
  Server Hostname:        www.newdev.gztest.com
  Server Port:            80
  Document Path:
  Document Length:        82522 bytes  #请求文档大小
  

  Concurrency Level:      50           #并发数
  Time taken for tests:   92.76140 seconds #全部请 求完成耗时
  Complete requests:      10000          #全部请求数
  Failed requests:        1974           #失败的请求
  (Connect: 0, Length: 1974, Exceptions: 0)
  Write errors:           0
  Total transferred:      827019400 bytes   #总传输大小
  HTML transferred:       825219400 bytes #整个场 景中的HTML内容传输量
  Requests per second:    108.61 [#/sec] (mean)   #每秒请 求数(平均)//大家最关心的指标之一,相当于 LR 中的每秒事务数,后面括 号中的 mean 表示这是一个平均值
  Time per request:       460.381 [ms] (mean)   #每次并发请求时间(所有并发) //大家最关心的指标之二,相当于 LR 中的平均事务响应时间, 后面括号中的 mean 表示这是一个平均值
  Time per request:       9.208 [ms] (mean, across all concurrent requests)   #每一请求时间(并发平均)  //每个请求实际运行时间的平均值
  Transfer rate:          8771.39 [Kbytes/sec] received    #传输速 率//平 均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题
  Percentage of the requests served within a certain time (ms)
  50%   2680
  66%   2806
  75%   2889
  80%   2996
  90%  11064
  95%  20161
  98%  21092
  99%  21417
  100%  21483 (longest request)
  //整个场景中所有请求的响应情况。在场景中每个请求都有一个响应时间,其 中50%的用户响应时间小于2680毫秒,60% 的用户响应时间小于2806毫秒,最大的响应时间小于21417毫秒
  由于对于并发请求,cpu实际上并不是同时处理的,而是按照每个 请求获得的时间片逐个轮转处理的,所以基本上第一个Time per request时间约等于第二个Time per request时间乘以并发请求数。
  

  

  Connection Times (ms)    #连接时 间
  min  mean[+/-sd] median   max
  Connect(#连接):        0    0   2.1      0      46
  Processing(#处理):   31  458  94.7    438    1078
  Waiting(#等待):         15  437  87.5    422     938
  Total:                           31  458  94.7    438    1078
  

  

  

  

  其 它参数:
  

  -n requests     全部请求数
  -c concurrency  并发数
  -t timelimit    最传等待回应时间
  -p postfile     POST数 据文件
  -T content-type POST Content-type
  -v verbosity    How much troubleshooting info to print
  -w              Print out results in HTML tables
  -i              Use HEAD instead of GET
  -x attributes   String to insert as table attributes
  -y attributes   String to insert as tr attributes
  -z attributes   String to insert as td or th attributes
  -C attribute    加入cookie, eg. 'Apache=1234. (repeatable)
  -H attribute    加入http头, eg. 'Accept-Encoding: gzip'
  Inserted after all normal header lines. (repeatable)
  -A attribute    http验证,分隔传递用户名及密码
  -P attribute    Add Basic Proxy Authentication, the attributes
  are a colon separated username and password.
  -X proxy:port   代理服务器
  -V              查看ab版本
  -k              Use HTTP KeepAlive feature
  -d              Do not show percentiles served table.
  -S              Do not show confidence estimators and warnings.
  -g filename     Output collected data to gnuplot format file.
  -e filename     Output CSV file with percentages served
  -h              Display usage information (this message)
  

  

  

  

  

  AB测试,200个请求,20个并发.这样的测试强度,CPU占了70-80%,w3p占用了70多M内存,本想多测几次,看看它的内存会不会涨上去,没 有测试机器没办法,开发机要干活.我估计CPU就有问题了,性能有好些个地方还需要优化.
  

  顺便把测试的工具用法作个记号
  

  基本用法:
  ab -n 全部请求数 -c 并发数 测试url
  例:ab -n 1000 -c 50 http://www.newdev.gztest.com/
  Server Software:         Microsoft-IIS/7.0
  Server Hostname:        www.newdev.gztest.com
  Server Port:            80
  Document Path:
  Document Length:        82522 bytes  #请求文档大小
  

  Concurrency Level:      50           #并发数
  Time taken for tests:   92.76140 seconds #全部请 求完成耗时
  Complete requests:      10000          #全部请求数
  Failed requests:        1974           #失败的请求
  (Connect: 0, Length: 1974, Exceptions: 0)
  Write errors:           0
  Total transferred:      827019400 bytes   #总传输大小
  HTML transferred:       825219400 bytes #整个场 景中的HTML内容传输量
  Requests per second:    108.61 [#/sec] (mean)   #每秒请 求数(平均)//大家最关心的指标之一,相当于 LR 中的每秒事务数,后面括 号中的 mean 表示这是一个平均值
  Time per request:       460.381 [ms] (mean)   #每次并发请求时间(所有并发) //大家最关心的指标之二,相当于 LR 中的平均事务响应时间, 后面括号中的 mean 表示这是一个平均值
  Time per request:       9.208 [ms] (mean, across all concurrent requests)   #每一请求时间(并发平均)  //每个请求实际运行时间的平均值
  Transfer rate:          8771.39 [Kbytes/sec] received    #传输速 率//平 均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题
  Percentage of the requests served within a certain time (ms)
  50%   2680
  66%   2806
  75%   2889
  80%   2996
  90%  11064
  95%  20161
  98%  21092
  99%  21417
  100%  21483 (longest request)
  //整个场景中所有请求的响应情况。在场景中每个请求都有一个响应时间,其 中50%的用户响应时间小于2680毫秒,60% 的用户响应时间小于2806毫秒,最大的响应时间小于21417毫秒
  由于对于并发请求,cpu实际上并不是同时处理的,而是按照每个 请求获得的时间片逐个轮转处理的,所以基本上第一个Time per request时间约等于第二个Time per request时间乘以并发请求数。
  

  

  Connection Times (ms)    #连接时 间
  min  mean[+/-sd] median   max
  Connect(#连接):        0    0   2.1      0      46
  Processing(#处理):   31  458  94.7    438    1078
  Waiting(#等待):         15  437  87.5    422     938
  Total:                           31  458  94.7    438    1078
  

  

  

  

  其 它参数:
  

  -n requests     全部请求数
  -c concurrency  并发数
  -t timelimit    最传等待回应时间
  -p postfile     POST数 据文件
  -T content-type POST Content-type
  -v verbosity    How much troubleshooting info to print
  -w              Print out results in HTML tables
  -i              Use HEAD instead of GET
  -x attributes   String to insert as table attributes
  -y attributes   String to insert as tr attributes
  -z attributes   String to insert as td or th attributes
  -C attribute    加入cookie, eg. 'Apache=1234. (repeatable)
  -H attribute    加入http头, eg. 'Accept-Encoding: gzip'
  Inserted after all normal header lines. (repeatable)
  -A attribute    http验证,分隔传递用户名及密码
  -P attribute    Add Basic Proxy Authentication, the attributes
  are a colon separated username and password.
  -X proxy:port   代理服务器
  -V              查看ab版本
  -k              Use HTTP KeepAlive feature
  -d              Do not show percentiles served table.
  -S              Do not show confidence estimators and warnings.
  -g filename     Output collected data to gnuplot format file.
  -e filename     Output CSV file with percentages served
  -h              Display usage information (this message)
  





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-642919-1-1.html 上篇帖子: 使用cronolog切割tomcat日志 下篇帖子: 书写关于tomcat的脚本
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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