jinhailang / blog

技术博客:知其然,知其所以然
https://github.com/jinhailang/blog/issues
60 stars 6 forks source link

ab 测试工具试用记录 #27

Open jinhailang opened 6 years ago

jinhailang commented 6 years ago

测试命令

ab -n100000 -c600 -H 'Host: httpbin.org' http://192.168.3.22:9001/test_limit > razor-1.0_abtest.out

-n 总请求数 -c 并发请求数 -H 请求头,可使用多次,可重复覆盖

并且将测试报告重定向到文件 razor-1.0_abtest.out

测试报告

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.3.22 (be patient)

Server Software:        openresty/1.11.2.2
Server Hostname:        192.168.3.22
Server Port:            9001

Document Path:          /test_limit
Document Length:        233 bytes

Concurrency Level:      600
Time taken for tests:   218.767 seconds
Complete requests:      100000
Failed requests:        99937
   (Connect: 0, Receive: 0, Length: 99937, Exceptions: 0)
Non-2xx responses:      100000
Total transferred:      16519656 bytes
HTML transferred:       1813545 bytes
Requests per second:    457.11 [#/sec] (mean)
Time per request:       1312.604 [ms] (mean)
Time per request:       2.188 [ms] (mean, across all concurrent requests)
Transfer rate:          73.74 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    2  72.2      1    3010
Processing:    11 1295 1913.9    289    9323
Waiting:        6  961 1646.4    202    6593
Total:         11 1297 1916.2    289    9485

Percentage of the requests served within a certain time (ms)
  50%    289
  66%    328
  75%   3197
  80%   3242
  90%   3336
  95%   6273
  98%   6314
  99%   6336
 100%   9485 (longest request)