1AB(1)                                 ab                                 AB(1)
2
3
4

NAME

6       ab - Apache HTTP server benchmarking tool
7
8

SYNOPSIS

10       ab [ -A auth-username:password ] [ -b windowsize ] [ -B local-address ]
11       [ -c concurrency ] [ -C cookie-name=value ] [ -d ] [ -e csv-file ] [ -f
12       protocol  ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k
13       ] [ -n requests ] [ -p POST-file ] [ -P proxy-auth-username:password  ]
14       [  -q ] [ -r ] [ -s timeout ] [ -S ] [ -t timelimit ] [ -T content-type
15       ] [ -u PUT-file ] [ -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes
16       ]  [  -X proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes ] [
17       -Z ciphersuite ] [http[s]://]hostname[:port]/path
18
19
20

SUMMARY

22       ab is a tool for benchmarking your Apache Hypertext  Transfer  Protocol
23       (HTTP)  server.  It  is  designed to give you an impression of how your
24       current Apache installation performs. This  especially  shows  you  how
25       many  requests  per second your Apache installation is capable of serv‐
26       ing.
27
28
29

OPTIONS

31       -A auth-username:password
32              Supply BASIC Authentication credentials to the server. The user‐
33              name  and  password  are separated by a single : and sent on the
34              wire base64 encoded. The string is sent  regardless  of  whether
35              the  server  needs  it  (i.e.,  has  sent  an 401 authentication
36              needed).
37
38       -b windowsize
39              Size of TCP send/receive buffer, in bytes.
40
41       -B local-address
42              Address to bind to when making outgoing connections.
43
44       -c concurrency
45              Number of multiple requests to perform at a time. Default is one
46              request at a time.
47
48       -C cookie-name=value
49              Add  a Cookie: line to the request. The argument is typically in
50              the form of a name=value pair. This field is repeatable.
51
52       -d     Do not display the "percentage served  within  XX  [ms]  table".
53              (legacy support).
54
55       -e csv-file
56              Write a Comma separated value (CSV) file which contains for each
57              percentage (from 1% to 100%) the time (in milliseconds) it  took
58              to  serve  that percentage of the requests. This is usually more
59              useful than the 'gnuplot'  file;  as  the  results  are  already
60              'binned'.
61
62       -f protocol
63              Specify SSL/TLS protocol (SSL2, SSL3, TLS1, or ALL).
64
65       -g gnuplot-file
66              Write  all  measured values out as a 'gnuplot' or TSV (Tab sepa‐
67              rate values) file. This file can easily be imported  into  pack‐
68              ages  like  Gnuplot,  IDL,  Mathematica, Igor or even Excel. The
69              labels are on the first line of the file.
70
71       -h     Display usage information.
72
73       -H custom-header
74              Append extra headers to the request. The argument  is  typically
75              in the form of a valid header line, containing a colon-separated
76              field-value pair (i.e., "Accept-Encoding: zip/zop;8bit").
77
78       -i     Do HEAD requests instead of GET.
79
80       -k     Enable  the  HTTP  KeepAlive  feature,  i.e.,  perform  multiple
81              requests within one HTTP session. Default is no KeepAlive.
82
83       -n requests
84              Number  of requests to perform for the benchmarking session. The
85              default is to just perform a single request which usually  leads
86              to non-representative benchmarking results.
87
88       -p POST-file
89              File containing data to POST. Remember to also set -T.
90
91       -P proxy-auth-username:password
92              Supply BASIC Authentication credentials to a proxy en-route. The
93              username and password are separated by a single :  and  sent  on
94              the  wire  base64  encoded.  The  string  is  sent regardless of
95              whether the proxy needs it (i.e., has sent an 407 proxy  authen‐
96              tication needed).
97
98       -q     When  processing  more  than 150 requests, ab outputs a progress
99              count on stderr every 10% or 100 requests or  so.  The  -q  flag
100              will suppress these messages.
101
102       -r     Don't exit on socket receive errors.
103
104       -s timeout
105              Maximum  number  of seconds to wait before the socket times out.
106              Default is 30 seconds.
107
108       -S     Do not display the median and  standard  deviation  values,  nor
109              display  the  warning/error messages when the average and median
110              are more than one or two times the standard deviation apart. And
111              default to the min/avg/max values. (legacy support).
112
113       -t timelimit
114              Maximum  number  of  seconds  to  spend  for  benchmarking. This
115              implies a -n 50000 internally. Use this to benchmark the  server
116              within  a  fixed  total  amount of time. Per default there is no
117              timelimit.
118
119       -T content-type
120              Content-type header to use for POST/PUT data, eg. application/x-
121              www-form-urlencoded. Default is text/plain.
122
123       -u PUT-file
124              File containing data to PUT. Remember to also set -T.
125
126       -v verbosity
127              Set verbosity level - 4 and above prints information on headers,
128              3 and above prints response codes (404, 200, etc.), 2 and  above
129              prints warnings and info.
130
131       -V     Display version number and exit.
132
133       -w     Print  out  results in HTML tables. Default table is two columns
134              wide, with a white background.
135
136       -x <table>-attributes
137              String to use as attributes for <table>. Attributes are inserted
138              <table here >.
139
140       -X proxy[:port]
141              Use a proxy server for the requests.
142
143       -y <tr>-attributes
144              String to use as attributes for <tr>.
145
146       -z <td>-attributes
147              String to use as attributes for <td>.
148
149       -Z ciphersuite
150              Specify SSL/TLS cipher suite (See openssl ciphers)
151
152

OUTPUT

154       The following list describes the values returned by ab:
155
156
157
158       Server Software
159              The  value,  if  any,  returned in the server HTTP header of the
160              first successful response. This includes all characters  in  the
161              header  from  beginning  to  the  point a character with decimal
162              value of 32 (most notably: a space or CR/LF) is detected.
163
164       Server Hostname
165              The DNS or IP address given on the command line
166
167       Server Port
168              The port to which ab is connecting. If no port is given  on  the
169              command  line,  this  will  default  to  80 for http and 443 for
170              https.
171
172       SSL/TLS Protocol
173              The  protocol  parameters  negotiated  between  the  client  and
174              server. This will only be printed if SSL is used.
175
176       Document Path
177              The request URI parsed from the command line string.
178
179       Document Length
180              This  is  the  size  in bytes of the first successfully returned
181              document. If the document length  changes  during  testing,  the
182              response is considered an error.
183
184       Concurrency Level
185              The number of concurrent clients used during the test
186
187       Time taken for tests
188              This  is the time taken from the moment the first socket connec‐
189              tion is created to the moment the last response is received
190
191       Complete requests
192              The number of successful responses received
193
194       Failed requests
195              The number of requests that were considered a  failure.  If  the
196              number  is greater than zero, another line will be printed show‐
197              ing the number of requests that failed due to connecting,  read‐
198              ing, incorrect content length, or exceptions.
199
200       Write errors
201              The number of errors that failed during write (broken pipe).
202
203       Non-2xx responses
204              The  number  of  responses  that  were  not in the 200 series of
205              response codes. If all responses were 200,  this  field  is  not
206              printed.
207
208       Keep-Alive requests
209              The number of connections that resulted in Keep-Alive requests
210
211       Total body sent
212              If  configured  to  send  data  as part of the test, this is the
213              total number of bytes sent during the tests. This field is omit‐
214              ted if the test did not include a body to send.
215
216       Total transferred
217              The  total number of bytes received from the server. This number
218              is essentially the number of bytes sent over the wire.
219
220       HTML transferred
221              The total number of document bytes  received  from  the  server.
222              This number excludes bytes received in HTTP headers
223
224       Requests per second
225              This  is  the  number  of requests per second. This value is the
226              result of dividing the number of  requests  by  the  total  time
227              taken
228
229       Time per request
230              The  average  time  spent per request. The first value is calcu‐
231              lated with the formula concurrency * timetaken  *  1000  /  done
232              while  the second value is calculated with the formula timetaken
233              * 1000 / done
234
235       Transfer rate
236              The rate of transfer as calculated by the  formula  totalread  /
237              1024 / timetaken
238
239

BUGS

241       There are various statically declared buffers of fixed length. Combined
242       with the lazy parsing of the command line arguments, the response head‐
243       ers from the server and other external inputs, this might bite you.
244
245
246       It  does  not  implement  HTTP/1.x  fully; only accepts some 'expected'
247       forms of responses. The rather heavy use of strstr(3) shows up  top  in
248       profile,  which  might  indicate a performance problem; i.e., you would
249       measure the ab performance rather than the server's.
250
251
252
253
254Apache HTTP Server                2013-01-09                             AB(1)
Impressum