ab 是apache 推出的压力测试工具,可以用来测试http服务器的性能,得出QPS
abs 则是apache 推出的压力测试工具,可以用来测试https服务器的性能,得出QPS
工具下载地址:https://www.apachehaus.com/cgi-bin/download.plx
工具官方文档地址:http://httpd.apache.org/docs/2.4/programs/ab.html
用法简介:下载工具进入Apache24/bin目录下载就可以看到ab.exe和abs.exe
在命令行中输入
ab -n 1000 -c 20 http://127.0.0.1:8080/
-n 要发多少个请求数
-c 每次进行多少请求
注意:必须是 http://127.0.0.1:8080/ ,“/” 不可以被省略,测试地址必须是一个url。
结果简析:
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software:
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /
Document Length: 131 bytes
Concurrency Level: 200
Time taken for tests: 0.990 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 269000 bytes
HTML transferred: 131000 bytes
Requests per second: 1010.45 [#/sec] (mean)
Time per request: 197.931 [ms] (mean)
Time per request: 0.990 [ms] (mean, across all concurrent requests)
Transfer rate: 265.44 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.4 0 2
Processing: 22 175 33.9 183 218
Waiting: 0 99 54.3 100 216
Total: 22 175 33.9 183 218
Percentage of the requests served within a certain time (ms)
50% 183
66% 187
75% 189
80% 191
90% 194
95% 200
98% 212
99% 215
100% 218 (longest request)
Requests per second: 1010.45 [#/sec] (mean) 就是QPS