举个栗子
  参数很多,一般我们用 -c 和 -n 参数可以了. 例如:
01 bixiaopeng@bixiaopengtekiMacBook-Pro ~$ ab -c 10 -n 1000 http://www.wirelessqa.com/?p=143
02 This is ApacheBench, Version 2.3 <$Revision: 655654 $>
03 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
04 Licensed to The Apache Software Foundation, http://www.apache.org/
05
06
07 Benchmarking www.wirelessqa.com (be patient)
08 Completed 100 requests
09 Completed 200 requests
10 Completed 300 requests
11 Completed 400 requests
12 Completed 500 requests
13 Completed 600 requests
14 Completed 700 requests
15 Completed 800 requests
16 Completed 900 requests
17 Completed 1000 requests
18 Finished 1000 requests
19
20
21
22
23 Server Software:        IIS
24 Server Hostname:        www.wirelessqa.com
25 Server Port:            80
26
27
28 Document Path:          /?p=143
29 Document Length:        40865 bytes
30
31
32 Concurrency Level:      10
33 Time taken for tests:   349.234 seconds
34 Complete requests:      1000
35 Failed requests:        674
36   (Connect: 0, Receive: 0, Length: 674, Exceptions: 0)
37 Write errors:           0
38 Total transferred:      41114189 bytes
39 HTML transferred:       40889965 bytes
40 Requests per second:    2.86 [#/sec] (mean)
41 Time per request:       3492.343 [ms] (mean)
42 Time per request:       349.234 [ms] (mean, across all concurrent requests)
43 Transfer rate:          114.97 [Kbytes/sec] received
44
45
46 Connection Times (ms)
47              min  mean[+/-sd] median   max
48 Connect:       35  161 401.6     59    3394
49 Processing:   571 3282 2723.1   2648   28374
50 Waiting:      309  654 767.3    538   21420
51 Total:        610 3443 2777.4   2826   28514
52
53
54 Percentage of the requests served within a certain time (ms)
55  50%   2826
56  66%   3636
57  75%   4364
58  80%   4799
59  90%   6239
60  95%   7744
61  98%  11263
62  99%  14251
63   28514 (longest request)
  结果:在同一时间有10个访问请求的情况下,完成1000次请求,失败674次,共花时间349.234秒,这个页面每秒平均处理2.86个请求