Apache AB性能测试工具使用教程

2019-01-17 03:49:47于海丽

              min  mean[+/-sd] median   max

Connect:        1    2   0.8      2       3

Processing:  2163 3981 3420.2   2957   13540

Waiting:     1305 3204 3595.3   2096   13169

Total:       2164 3983 3420.0   2959   13541

//以下是整个场景中所有请求的响应情况。在场景中每个请求都有一个响应时间,其中50%的用户响应时间小于2959毫秒,66% 的用户响应时间小于3074毫秒,最大的响应时间小于13541 毫秒。由于对于并发请求,cpu实际上并不是同时处理的,而是按照每个请求获得的时间片逐个轮转处理的,所以基本上第一个Time per request时间约等于第二个Time per request时间乘以并发请求数。

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

  50%   2959

  66%   3074

  75%   3974

  80%   4008

  90%  13541

  95%  13541

  98%  13541

  99%  13541

 100%  13541 (longest request)

下面是ab的指令中参数的介绍:

-n requests     全部请求数

-c concurrency  并发数

-t timelimit    最传等待回应时间

-p postfile     POST数据文件

-T content-type POST Content-type

-v verbosity    How much troubleshooting info to print

-w              Print out results in HTML tables

-i              Use HEAD instead of GET

-x attributes   String to insert as table attributes

-y attributes   String to insert as tr attributes

-z attributes   String to insert as td or th attributes

-C attribute    加入cookie, eg. ‘Apache=1234. (repeatable)

-H attribute    加入http头, eg. ‘Accept-Encoding: gzip'

                Inserted after all normal header lines. (repeatable)

-A attribute    http验证,分隔传递用户名及密码

-P attribute    Add Basic Proxy Authentication, the attributes

                are a colon separated username and password.

-X proxy:port   代理服务器