十五年测试老手,长期负责WEB\APP 项目测试,目前主要负责团队管理工作。

AB(Apache Benchmark)

上一篇 / 下一篇  2011-07-31 20:12:07 / 个人分类:性能测试

APACHE自带的压力测试工具,在APACHEbin目录下。

aWL4C2u}/ac H*?h6Z0

使用格式:

:\RGi%x/\;QLd0

./ab [options] [http://]hostname[:port]/path51Testing软件测试网"V4^ AA!uT_"M:^W

参数:51Testing软件测试网lCcLdL

-n      requests Number of requests to perform

6Y2L5s!r2[ A:t _5bS0

-c      concurrency Number of multiple requests to make51Testing软件测试网 uo4mYc9KP l&Xw(qz

-t      timelimit Seconds to max. wait for responses

:E8G~Q,o0

-p      postfile File containing data to POST

Q7~.J]#yvs'x0

-T      content-type Content-type header for POSTING

.xW0bR,` KY%ou9t$c0

-v      verbosity How much troubleshooting info to print51Testing软件测试网c3DH h-F#^a b0H

-w     Print out results in HTML tables51Testing软件测试网 o(H0j4~+Qp8sc

-i       Use HEAD instead of GET

&|o7{%_B4ve*? }0

-x      attributes String to insert as table attributes

h4}\d q6b0

-y      attributes String to insert as tr attributes

J P8]@H!v$r0

-z      attributes String to insert as td or th attributes

Vh ?3q4B_KyV0

-C     Add cookie,eg.’Apache=1234.(repeatable)

0B?;VOcJq0

还有很多参数,可以通过如下命令了解:

)Nn tv M:u9^3Eaf}0

./ab –h

T:AvSn;`Q-j N;R0

在结果中,我们最关心的指标:

*OiSh3d1z a0

Requests per second       //相当于LR中的每秒事务数

g*n*Yx1`3i*G0

Time per second                //相当于LR中的平均事务响应时间51Testing软件测试网z;B*zRLS+?&z X-c

另外在结果的分析中,我们还需要分析的有:

bJ3Z-Z#Qe'j;s0

网络上消耗的时间分解:connect\processing\waiting\total51Testing软件测试网8cJ_;if _&K

响应分布Percentage of the requests served within a certain time(ms)51Testing软件测试网3yE ]&M J+gZ

网络流量Transfer rate,可以帮助排除是否存在网络流量过大导致响应时间延长的问题

QV:~[VQ0

TAG: 性能测试 AB

 

评分:0

我来说两句

Open Toolbar