apache ab ApacheBench 使用

官方文档:

http://httpd.apache.org/docs/2.0/en/programs/ab.html

 

post的测试方法

./ab -n 100 -c 10 -e postout -p post  -T’application/x-www-form-urlencoded’ http://test.com

post文件内容:test=test

说明两个参数 

dir和query

有几个参数就多少航

 

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

 

Benchmarking localhost (be patient)…..done

 

 

Server Software:        Apache/2.2.17

Server Hostname:        test.com

Server Port:            25000

 

Document Path:          /

Document Length:        580 bytes

 

Concurrency Level:      20

Time taken for tests:   4.315 seconds

Complete requests:      100

Failed requests:        0

Write errors:           0

Total transferred:      75200 bytes

Total POSTed:           66500

HTML transferred:       58000 bytes

Requests per second:    23.18 [#/sec] (mean)

Time per request:       862.976 [ms] (mean)

Time per request:       43.149 [ms] (mean, across all concurrent requests)

Transfer rate:          17.02 [Kbytes/sec] received

15.05 kb/s sent

32.07 kb/s total

 

Connection Times (ms)

min  mean[+/-sd] median   max

Connect:        0    0   0.1      0       1

Processing:   396  816 178.2    807    1237

Waiting:      396  816 178.2    807    1237

Total:        396  817 178.2    807    1237

 

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

50%    807

66%    898

75%    942

80%    959

90%   1014

95%   1134

98%   1198

99%   1237

100%   1237 (longest request)

 

get的测试方法 

./ab -n 100 -c 20 ’http://test.com’

结果如下

 

 

Server Software:        Apache/2.2.17

Server Hostname:        test.com

Server Port:            25000

 

Document Path:          /

Document Length:        1964 bytes

 

Concurrency Level:      200

Time taken for tests:   357.393 seconds

Complete requests:      10000

Failed requests:        0

Write errors:           0

Total transferred:      21370000 bytes

HTML transferred:       19640000 bytes

Requests per second:    27.98 [#/sec] (mean)

Time per request:       7147.860 [ms] (mean)

Time per request:       35.739 [ms] (mean, across all concurrent requests)

Transfer rate:          58.39 [Kbytes/sec] received

 

Connection Times (ms)

min  mean[+/-sd] median   max

Connect:        0    0   1.3      0      18

Processing:   372 7084 547.4   7145    8793

Waiting:      372 7082 547.0   7143    8793

Total:        373 7084 547.0   7145    8800

 

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

50%   7145

66%   7223

75%   7274

80%   7305

90%   7395

95%   7478

98%   7668

99%   7855

100%   8800 (longest request)

 

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>