ab压力测试常用场景

ab是apache自带的一个很好用的压力测试工具。常用的命令如下:

ab -n 100 -c 100 url

-n:请求次数

-c:并发次数

结果如下:

 

Concurrency Level:      100
Time taken for tests:   0.28327 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      251000 bytes
HTML transferred:       228300 bytes
Requests per second:    3530.20 [#/sec] (mean)
Time per request:       28.327 [ms] (mean)
Time per request:       0.283 [ms] (mean, across all concurrent requests)
Transfer rate:          8648.99 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        2    2   0.7      2       3
Processing:     4   13   5.6     14      23
Waiting:        3   13   5.6     13      22
Total:          6   16   6.0     16      26

Percentage of the requests served within a certain time (ms)
  50%     16
  66%     20
  75%     21
  80%     22
  90%     24
  95%     26
  98%     26
  99%     26
 100%     26 (longest request)
[search@QT-0104 ~]$ 

 主要关注点:

 

Time per request:    每次请求的耗时
Percentage of the requests served within a certain time (ms) 耗时百分比
  50%     16
  66%     20
  75%     21
  80%     22
  90%     24
  95%     26
  98%     26
  99%     26
 100%     26 (longest request)

你可能感兴趣的:(压力测试)