ab压力测试 及结果分析

官方下载地址:https://www.apachehaus.com/cgi-bin/download.plx

压力测试

D:\Users\zhiqiangzhou\Desktop\ab>ab -n 10000 -c 100 http://localhost:8281/tomcat
/getTestStr
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/

Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests


Server Software:
Server Hostname:        localhost
Server Port:            8281

Document Path:          /tomcat/getTestStr
Document Length:        9 bytes

Concurrency Level:      100
Time taken for tests:   6.117388 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      1410000 bytes
HTML transferred:       90000 bytes
Requests per second:    1634.68 [#/sec] (mean)
Time per request:       61.174 [ms] (mean)
Time per request:       0.612 [ms] (mean, across all concurrent requests)
Transfer rate:          224.93 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.4      0      12
Processing:    49   59  36.2     51     446
Waiting:       49   58  30.0     50     346
Total:         49   59  36.2     51     446

Percentage of the requests served within a certain time (ms)
  50%     51
  66%     52
  75%     54
  80%     57
  90%     69
  95%     90
  98%    177
  99%    301
 100%    446 (longest request)

结果分析

##-n 表示请求数,-c 表示并发数. 
D:\Users\zhiqiangzhou\Desktop\ab>ab -n 10000 -c 100 http://localhost:8281/tomcat
/getTestStr
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/

Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests

##服务器软件和版本
Server Software:
##请求的地址/域名
Server Hostname:        localhost
##端口
Server Port:            8281

##请求的路径
Document Path:          /tomcat/getTestStr
##页面数据/返回的数据量
Document Length:        9 bytes

##并发数
Concurrency Level:      100
##共使用了多少时间
Time taken for tests:   6.117388 seconds
##请求数 
Complete requests:      10000
##失败请求
Failed requests:        0
Write errors:           0
##总共传输字节数,包含http的头信息等
Total transferred:      1410000 bytes
##html字节数,实际的页面传递字节数 
HTML transferred:       90000 bytes
##每秒多少请求,这个是非常重要的参数数值,服务器的吞吐量
Requests per second:    1634.68 [#/sec] (mean)
##用户平均请求等待时间
Time per request:       61.174 [ms] (mean)
##服务器平均处理时间,也就是服务器吞吐量的倒数
Time per request:       0.612 [ms] (mean, across all concurrent requests)
 ##每秒获取的数据长度
Transfer rate:          224.93 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
##连接的最小时间,平均值,标准差,中值,最大值
Connect:        0    0   0.4      0      12
##处理时间
Processing:    49   59  36.2     51     446
##等待时间
Waiting:       49   58  30.0     50     346
##合计时间
Total:         49   59  36.2     51     446


Percentage of the requests served within a certain time (ms)
  ## 50%的请求在51ms内返回 
  50%     51
  ## 66%的请求在52ms内返回
  66%     52
  75%     54
  80%     57
  90%     69
  95%     90
  98%    177
  99%    301
 100%    446 (longest request)
发布了148 篇原创文章 · 获赞 159 · 访问量 10万+

猜你喜欢

转载自blog.csdn.net/qq_33594101/article/details/103398882