武英斌-博客

ab 压测详解

发布时间:4年前热度: 586 ℃评论数:

[root@centos7 ~]#ab -c 10 -n 100 http://a.ilanni.com/index.php

    -c    10表示并发用户数为10

    -n    100表示请求总数为100

    http://a.ilanni.com/index.php表示请求的目标URL

    这行表示同时处理100个请求并运行10次index.php文件。


[root@centos7 ~]#ab -c 10 -n 100 http://a.ilanni.com/index.php

Benchmarking 47.93.96.25 (be patient).....done


Server Software:        Apache/2.4.29  ##apache版本 

Server Hostname:        ip地址   ##请求的机子 

Server Port:            80  ##请求端口


Document Path:          index.php

Document Length:        18483 bytes  ##页面长度


Concurrency Level:      10  ##并发数

Time taken for tests:   25.343 seconds  ##共使用了多少时间

Complete requests:      100  ##请求数

Failed requests:        11  ##失败请求

   (Connect: 0, Receive: 0, Length: 11, Exceptions: 0)

Total transferred:      1873511 bytes  ##总共传输字节数,包含http的头信息等

HTML transferred:       1848311 bytes  ##html字节数,实际的页面传递字节数

Requests per second:    3.95 [#/sec] (mean)  ##每秒多少请求,这个是非常重要的参数数值,服务器的吞吐量

Time per request:       2534.265 [ms] (mean)  ##用户平均请求等待时间

Time per request:       253.426 [ms] (mean, across all concurrent requests)  ##服务器平均处理时间,

Transfer rate:          72.19 [Kbytes/sec] received  ##每秒获取的数据长度


Connection Times (ms)

              min  mean[+/-sd] median   max

Connect:        0    8   3.9     10      13

Processing:  1222 2453 322.6   2520    3436

Waiting:     1175 2385 320.4   2452    3372

Total:       1222 2461 322.5   2528    3444


Percentage of the requests served within a certain time (ms)

  50%   2528  ## 50%的请求在25ms内返回 

  66%   2534  ## 60%的请求在26ms内返回 

  75%   2538

  80%   2539

  90%   2545

  95%   2556

  98%   3395

  99%   3444

 100%   3444 (longest request)

————————————————

版权声明:本文为CSDN博主「咻一咻」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/qq_37187976/article/details/79209059

手机扫码访问