使用ab进行压力测试

2018-07-03  本文已影响132人  Bobby0322

使用ab进行压力测试


abDemo abDemo2

压力测试中需要掌握的几个基本概念

ab -n 1000 -c 100 -w http://pav6nuon9.bkt.clouddn.com/1-1.jpg?imageMogr2/crop/!1230x284a267a1159 >>c:\1.html

上面的测试用例表示100并发的情况下,共测试访问index.php脚本1000次,并将测试结果保存到c:\1.html文件中。

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 1997-2005 The Apache Software Foundation, http://www.apache.org/
Server Software:    NWS_TCloud_S1
Server Hostname:    pav6nuon9.bkt.clouddn.com
Server Port:    80
Document Path:  /1-1.jpg?imageMogr2/crop/!1230x284a267a1159
Document Length:    56056 bytes
Concurrency Level:  100
Time taken for tests:   0.7149 seconds
Complete requests:  1000
Failed requests:    0
Total transferred:  56670905 bytes
HTML transferred:   56056000 bytes
Requests per second:    139.88
Transfer rate:  7927.11 kb/s received
Connnection Times (ms)
    min avg max
Connect:    2   6   1345
Processing: 19  683 578
Total:  21  689 1923

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 1997-2005 The Apache Software Foundation, http://www.apache.org/
Server Software:    NWS_TCloud_S1
Server Hostname:    pav6nuon9.bkt.clouddn.com
Server Port:    80
Document Path:  /1-1.jpg?imageMogr2/crop/!1230x284a267a1159
Document Length:    56056 bytes       #请求文档大小
Concurrency Level:  100               #并发数  
Time taken for tests:   0.7149 seconds    #全部请求完成耗时
Complete requests:  1000              #全部请求数
Failed requests:    0                 #失败的请求
Total transferred:  56670905 bytes    #总传输大小 
HTML transferred:   56056000 bytes    #整个场景中的HTML内容传输量
Requests per second:    139.88            #每秒请求数(平均),大家最关心的指标之一,相当于 LR 中的每秒事务数,后面括号中的 mean 表示这是一个平均值      
Transfer rate:  7927.11 kb/s received     #传输速率,平均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题
Connnection Times (ms)
    min avg max
Connect:    2   6   1345       #连接时间
Processing: 19  683 578
Total:  21  689 1923

上一篇下一篇

猜你喜欢

热点阅读