IDO老徐,在深圳,某上市公司质量部负责人,干了十二年软件测试,公号"简尚" ,博客isTester.com ,关注「软件测试从业者综合能力提升」,微信957863300

推荐:Apache 压力测试工具ab

上一篇 / 下一篇  2016-03-29 19:06:25 / 个人分类:测试工具

51Testing软件测试网'[q/xjC/l$q+w
51Testing软件测试网 jd0_QFF
关于压力测试
很多同学只知道LR、jmeter

?'y,HQK0

在 Apache 有个叫 ab(ApacheBench) 的程序, 此程序是专门用在做压力测试用的软件. ApacheBench(ab) 用来测试 apache 执行效率,可以用来测试网站的压力工具.

RDJ1w1e;D/m0

ab 参数51Testing软件测试网4vK*I0{$}dQW#y6R'Hp

ab 参数:

L(p:Le8S-A/i0

Usage: /usr/sbin/ab [options] [http[s]://]hostname[:port]/path

6j5z,I_lA_Qn ^0

Options are:

/C8f/C4q.?'M0

§ -n requests Number of requests to perform

|M1mMo3I,j0

§ -c concurrency Number of multiple requests to make51Testing软件测试网/y z}:EM(v;l'x

§ -t timelimit Seconds to max. wait for responses51Testing软件测试网:C^\!GM"T-m~0R

§ -p postfile File containg data to POST

Hf4Co:{hU\[l0

§ -T content-type Content-type header for POSTing51Testing软件测试网a}` T`9V

§ -v verbosity How much troubleshooting info to print

gQ Q"i(]"o5N0

§ -w Print out results in HTML tables

7^!~VoD[8j+pM{0

§ -i Use HEAD instead of GET51Testing软件测试网&Z,g(kS?"E

§ -x attributes String to insert as table attributes

cs:wf*I[vF-w0

§ -y attributes String to insert as tr attributes51Testing软件测试网1b6Zn I%^

§ -z attributes String to insert as td or th attributes51Testing软件测试网0@ V;D+JS(GK@+C

§ -C attribute Add cookie, eg. 'Apache=1234' (repeatable)

r:b3m#J`\;VQr:n_J0

§ -H attribute Add Arbitrary header line, eg. 'Accept-Encoding: zop'

q#Ed5z Y0R8H9U[#C0

§ Inserted after all normal header lines. (repeatable)

D:WC,Qga0

§ -A attribute Add Basic WWW Authentication, the attributes

:]UYs9z"I;G0

§ are a colon separated username and password.51Testing软件测试网9DA:U&K,ZE

§ -P attribute Add Basic Proxy Authentication, the attributes

n6{C'eIB8R0

§ are a colon separated username and password.

h)v#]"xS3A0

§ -X proxy:port Proxyserver and port number to use51Testing软件测试网 F"R*R3A'\%V

§ -V Print version number and exit51Testing软件测试网,o4ER4\S!Oy'b H

§ -k Use HTTP KeepAlive feature

A`%K9V*WEY%@.y0

§ -d Do not show percentiles served table.

']CWWE2XJ-g0

§ -S Do not show confidence estimators and warnings.

gn*|T$rbtP0

§ -g filename Output collected data to gnuplot format file.51Testing软件测试网%YHTwK B

§ -e filename Output CSV file with percentages served

~IME_,Y$u lI0

§ -s Use httpS instead of HTTP (SSL)

kB.T/ZmY&LV)Gs5i0

§ -h Display usage information (this message)51Testing软件测试网-PI6a0W)aI

ab 使用51Testing软件测试网9D YO#Z^p9_&B

ab使用范例: 

]Yi,F,x'N0

要执行 1000 次的 connection, 20 次的 concurrent (并行, 同时):51Testing软件测试网 l3u$R hJD

语法: ab -n 1000 -c 20 http://localhost/

Hb'P_ p*w(T8o0B.w0

产生出来的结果. 要注意的是以下几个:

XeR[\!C |k"LG&{#H0

§ Time taken for tests: 总共执行花了多久的时间.(以上 1000 次共多久)

!{T1\5wB0

§ Requests per second: 每秒平均可以处理多少个 connection.51Testing软件测试网&R0R;}!G3K3\


$X6H%Q,{*_8gE(pN0

6s-Ujt _@ a;pa9H0
具体有兴趣,大家可以研究下

0l-C$b2@B:l0
ab 可运行在linux  & windows平台~
51Testing软件测试网C7K K7D|O9E&i

nlz?6^Y`?0

zi)@:m&VbZ0
51Testing软件测试网 e m)oxy2s3w
最后,
apache的ab工具也算是一种ddos攻击工具

TAG: 性能测试工具 软件测试 压力测试

 

评分:0

我来说两句

xuquan

xuquan

IDO老徐,坐标深圳,测试经理,干了十年测试,公号"简尚" ,个人博客isTester.com ,关注「软件测试从业者综合能力提升」,微信957863300

日历

« 2024-04-17  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 913702
  • 日志数: 427
  • 建立时间: 2012-06-04
  • 更新时间: 2022-02-23

RSS订阅

Open Toolbar