]> granicus.if.org Git - apache/blob - docs/manual/programs/ab.html.en
move es and fr targets to *.utf8 extension. Update transformation
[apache] / docs / manual / programs / ab.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
4 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
5 <!--
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7               This file is generated from xml source: DO NOT EDIT
8         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9       -->
10 <title>ab - Apache HTTP server benchmarking tool - Apache HTTP Server Version 2.5</title>
11 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
12 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
13 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
14 <script src="../style/scripts/prettify.min.js" type="text/javascript">
15 </script>
16
17 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
18 <body id="manual-page"><div id="page-header">
19 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
20 <p class="apache">Apache HTTP Server Version 2.5</p>
21 <img alt="" src="../images/feather.png" /></div>
22 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
23 <div id="path">
24 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Programs</a></div><div id="page-content"><div id="preamble"><h1>ab - Apache HTTP server benchmarking tool</h1>
25 <div class="toplang">
26 <p><span>Available Languages: </span><a href="../en/programs/ab.html" title="English">&nbsp;en&nbsp;</a> |
27 <a href="../fr/programs/ab.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
28 <a href="../ko/programs/ab.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
29 <a href="../tr/programs/ab.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
30 </div>
31
32     <p><code>ab</code> is a tool for benchmarking your Apache Hypertext
33     Transfer Protocol (HTTP) server. It is designed to give you an impression
34     of how your current Apache installation performs. This especially shows
35     you how many requests per second your Apache installation is capable of
36     serving.</p>
37 </div>
38 <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#synopsis">Synopsis</a></li>
39 <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li>
40 <li><img alt="" src="../images/down.gif" /> <a href="#output">Output</a></li>
41 <li><img alt="" src="../images/down.gif" /> <a href="#bugs">Bugs</a></li>
42 </ul><h3>See also</h3><ul class="seealso"><li><code class="program"><a href="../programs/httpd.html">httpd</a></code></li><li><a href="#comments_section">Comments</a></li></ul></div>
43 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
44 <div class="section">
45 <h2><a name="synopsis" id="synopsis">Synopsis</a><a title="Permanent link" href="#synopsis" class="permalink">&para;</a></h2>
46     <p><code><strong>ab</strong>
47     [ -<strong>A</strong> <var>auth-username</var>:<var>password</var> ]
48     [ -<strong>b</strong> <var>windowsize</var> ]
49     [ -<strong>B</strong> <var>local-address</var> ]
50     [ -<strong>c</strong> <var>concurrency</var> ]
51     [ -<strong>C</strong> <var>cookie-name</var>=<var>value</var> ]
52     [ -<strong>d</strong> ]
53     [ -<strong>e</strong> <var>csv-file</var> ]
54     [ -<strong>E</strong> <var>client-certificate file</var> ]
55     [ -<strong>f</strong> <var>protocol</var> ]
56     [ -<strong>g</strong> <var>gnuplot-file</var> ]
57     [ -<strong>h</strong> ]
58     [ -<strong>H</strong> <var>custom-header</var> ]
59     [ -<strong>i</strong> ]
60     [ -<strong>k</strong> ]
61     [ -<strong>l</strong> ]
62     [ -<strong>m</strong> <var>HTTP-method</var> ]
63     [ -<strong>n</strong> <var>requests</var> ]
64     [ -<strong>p</strong> <var>POST-file</var> ]
65     [ -<strong>P</strong> <var>proxy-auth-username</var>:<var>password</var> ]
66     [ -<strong>q</strong> ]
67     [ -<strong>r</strong> ]
68     [ -<strong>s</strong> <var>timeout</var> ]
69     [ -<strong>S</strong> ]
70     [ -<strong>t</strong> <var>timelimit</var> ]
71     [ -<strong>T</strong> <var>content-type</var> ]
72     [ -<strong>u</strong> <var>PUT-file</var> ]
73     [ -<strong>v</strong> <var>verbosity</var>]
74     [ -<strong>V</strong> ]
75     [ -<strong>w</strong> ]
76     [ -<strong>x</strong> <var>&lt;table&gt;-attributes</var> ]
77     [ -<strong>X</strong> <var>proxy</var>[:<var>port</var>] ]
78     [ -<strong>y</strong> <var>&lt;tr&gt;-attributes</var> ]
79     [ -<strong>z</strong> <var>&lt;td&gt;-attributes</var> ]
80     [ -<strong>Z</strong> <var>ciphersuite</var> ]
81     [http[s]://]<var>hostname</var>[:<var>port</var>]/<var>path</var></code></p>
82 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
83 <div class="section">
84 <h2><a name="options" id="options">Options</a><a title="Permanent link" href="#options" class="permalink">&para;</a></h2>
85     <dl>
86     <dt><code>-A <var>auth-username</var>:<var>password</var></code></dt>
87     <dd>Supply BASIC Authentication credentials to the server. The username and
88     password are separated by a single <code>:</code> and sent on the wire
89     base64 encoded. The string is sent regardless of whether the server needs
90     it (<em>i.e.</em>, has sent an 401  authentication needed).</dd>
91
92     <dt><code>-b <var>windowsize</var></code></dt>
93     <dd>Size of TCP send/receive buffer, in bytes.</dd>
94
95     <dt><code>-B <var>local-address</var></code></dt>
96     <dd>Address to bind to when making outgoing connections.</dd>
97
98     <dt><code>-c <var>concurrency</var></code></dt>
99     <dd>Number of multiple requests to perform at a time. Default is one
100     request at a time.</dd>
101
102     <dt><code>-C <var>cookie-name</var>=<var>value</var></code></dt>
103     <dd>Add a <code>Cookie:</code> line to the request. The  argument  is
104     typically in the form of a <code><var>name</var>=<var>value</var></code>
105     pair. This field is repeatable.</dd>
106
107     <dt><code>-d</code></dt>
108     <dd>Do not display the "percentage served within XX [ms] table". (legacy
109     support).</dd>
110
111     <dt><code>-e <var>csv-file</var></code></dt>
112     <dd>Write a Comma separated value (CSV) file which contains for each
113     percentage (from 1% to 100%) the time (in milliseconds) it took to serve
114     that percentage of the requests. This is usually more useful than the
115     'gnuplot' file; as the results are already 'binned'.</dd>
116
117     <dt><code>-E <var>client-certificate-file</var></code></dt>
118     <dd>When connecting to an SSL website, use the provided client certificate
119     in PEM format to authenticate with the server. The file is expected to
120     contain the client certificate, followed by intermediate certificates,
121     followed by the private key. Available in 2.4.36 and later.</dd>
122
123     <dt><code>-f <var>protocol</var></code></dt>
124     <dd>Specify SSL/TLS protocol (SSL2, SSL3, TLS1, TLS1.1, TLS1.2, or ALL).<br />
125     TLS1.1 and TLS1.2 support available in 2.4.4 and later.</dd>
126
127     <dt><code>-g <var>gnuplot-file</var></code></dt>
128     <dd>Write all measured values out as a 'gnuplot' or TSV (Tab separate
129     values) file. This file can easily be imported into packages like Gnuplot,
130     IDL, Mathematica, Igor or even Excel. The labels are on the first line of
131     the file. </dd>
132
133     <dt><code>-h</code></dt>
134     <dd>Display usage information.</dd>
135
136     <dt><code>-H <var>custom-header</var></code></dt>
137     <dd>Append extra headers to the request.  The  argument  is typically in
138     the form of a valid header line, containing a colon-separated field-value
139     pair (<em>i.e.</em>, <code>"Accept-Encoding: zip/zop;8bit"</code>).</dd>
140
141     <dt><code>-i</code></dt>
142     <dd>Do <code>HEAD</code> requests instead of <code>GET</code>.</dd>
143
144     <dt><code>-k</code></dt>
145     <dd>Enable the HTTP KeepAlive feature, <em>i.e.</em>, perform multiple
146     requests within one HTTP session. Default is no KeepAlive.</dd>
147
148     <dt><code>-l</code></dt>
149     <dd>Do not report errors if the length of the responses is not constant. This
150     can be useful for dynamic pages.<br />
151     Available in 2.4.7 and later.
152     </dd>
153
154     <dt><code>-m <var>HTTP-method</var></code></dt>
155     <dd>Custom HTTP method for the requests.<br />
156     Available in 2.4.10 and later.</dd>
157
158     <dt><code>-n <var>requests</var></code></dt>
159     <dd>Number of requests to perform for the benchmarking session. The default
160     is to just perform a single request which usually leads to
161     non-representative benchmarking results.</dd>
162
163     <dt><code>-p <var>POST-file</var></code></dt>
164     <dd>File containing data to POST.  Remember to also set <code>-T</code>.</dd>
165
166     <dt><code>-P <var>proxy-auth-username</var>:<var>password</var></code></dt>
167     <dd>Supply BASIC Authentication credentials to a proxy en-route. The
168     username and password are separated by a single <code>:</code> and sent on
169     the  wire base64 encoded. The string is sent regardless of whether the
170     proxy needs it (<em>i.e.</em>, has  sent an 407 proxy authentication
171     needed).</dd>
172
173     <dt><code>-q</code></dt>
174     <dd>When processing more than 150 requests, <code>ab</code> outputs a
175     progress count on <code>stderr</code> every 10% or 100 requests or so. The
176     <code>-q</code> flag will suppress these messages.</dd>
177
178     <dt><code>-r</code></dt>
179     <dd>Don't exit on socket receive errors.</dd>
180
181     <dt><code>-s <var>timeout</var></code></dt>
182     <dd>Maximum number of seconds to wait before the socket times out.
183     Default is 30 seconds.<br />
184     Available in 2.4.4 and later.</dd>
185
186     <dt><code>-S</code></dt>
187     <dd>Do not display the median and standard deviation values, nor display
188     the warning/error messages when the average and median are more than
189     one or two times the standard deviation apart. And default to the
190     min/avg/max values. (legacy support).</dd>
191
192     <dt><code>-t <var>timelimit</var></code></dt>
193     <dd>Maximum number of seconds to  spend  for  benchmarking. This implies a
194     <code>-n 50000</code> internally. Use this to benchmark the server within a
195     fixed total amount of time. Per default there is no timelimit.</dd>
196
197     <dt><code>-T <var>content-type</var></code></dt>
198     <dd>Content-type header to use for POST/PUT data, eg.
199     <code>application/x-www-form-urlencoded</code>.
200     Default is <code>text/plain</code>.</dd>
201
202     <dt><code>-u <var>PUT-file</var></code></dt>
203     <dd>File containing data to PUT.  Remember to also set <code>-T</code>.</dd>
204
205     <dt><code>-v <var>verbosity</var></code></dt>
206     <dd>Set verbosity level - <code>4</code> and above prints information on
207     headers, <code>3</code> and above prints response codes (404, 200, etc.),
208     <code>2</code> and above prints warnings and info.</dd>
209
210     <dt><code>-V</code></dt>
211     <dd>Display version number and exit.</dd>
212
213     <dt><code>-w</code></dt>
214     <dd>Print out results in HTML tables. Default table is two columns wide,
215     with a white background.</dd>
216
217     <dt><code>-x <var>&lt;table&gt;-attributes</var></code></dt>
218     <dd>String to use as attributes for <code>&lt;table&gt;</code>. Attributes
219     are inserted <code>&lt;table <var>here</var> &gt;</code>.</dd>
220
221     <dt><code>-X <var>proxy</var>[:<var>port</var>]</code></dt>
222     <dd>Use a proxy server for the requests.</dd>
223
224     <dt><code>-y <var>&lt;tr&gt;-attributes</var></code></dt>
225     <dd>String to use as attributes for <code>&lt;tr&gt;</code>.</dd>
226
227     <dt><code>-z <var>&lt;td&gt;-attributes</var></code></dt>
228     <dd>String to use as attributes for <code>&lt;td&gt;</code>.</dd>
229
230     <dt><code>-Z <var>ciphersuite</var></code></dt>
231     <dd>Specify SSL/TLS cipher suite (See openssl ciphers)</dd>
232     </dl>
233 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
234 <div class="section">
235 <h2><a name="output" id="output">Output</a><a title="Permanent link" href="#output" class="permalink">&para;</a></h2>
236     <p>The following list describes the values returned by <code>ab</code>:
237     </p>
238
239     <dl>
240         <dt>Server Software</dt>
241         <dd>The value, if any, returned in the <var>server</var> HTTP header
242         of the first successful response. This includes all characters in the
243         header from beginning to the point a character with decimal value of 32
244         (most notably: a space or CR/LF) is detected.</dd>
245
246         <dt>Server Hostname</dt>
247         <dd>The DNS or IP address given on the command line</dd>
248
249         <dt>Server Port</dt>
250         <dd>The port to which ab is connecting. If no port is given on the
251         command line, this will default to 80 for http and 443 for
252         https.</dd>
253
254         <dt>SSL/TLS Protocol</dt>
255         <dd>The protocol parameters negotiated between the client and server.
256         This will only be printed if SSL is used.</dd>
257
258         <dt>Document Path</dt>
259         <dd>The request URI parsed from the command line string.</dd>
260
261         <dt>Document Length</dt>
262         <dd>This is the size in bytes of the first successfully returned document.
263         If the document length changes during testing, the response is
264         considered an error.</dd>
265
266         <dt>Concurrency Level</dt>
267         <dd>The number of concurrent clients used during the test</dd>
268
269         <dt>Time taken for tests</dt>
270         <dd>This is the time taken from the moment the first socket connection
271         is created to the moment the last response is received</dd>
272
273         <dt>Complete requests</dt>
274         <dd>The number of successful responses received</dd>
275
276         <dt>Failed requests</dt>
277         <dd>The number of requests that were considered a failure. If the
278         number is greater than zero, another line will be printed showing the
279         number of requests that failed due to connecting, reading, incorrect
280         content length, or exceptions.</dd>
281
282         <dt>Write errors</dt>
283         <dd>The number of errors that failed during write (broken pipe).</dd>
284
285         <dt>Non-2xx responses</dt>
286         <dd>The number of responses that were not in the 200 series of response
287         codes. If all responses were 200, this field is not printed.</dd>
288
289         <dt>Keep-Alive requests</dt>
290         <dd>The number of connections that resulted in Keep-Alive requests</dd>
291
292         <dt>Total body sent</dt>
293         <dd>If configured to send data as part of the test, this is the total
294         number of bytes sent during the tests. This field is omitted if the test
295         did not include a body to send.</dd>
296
297         <dt>Total transferred</dt>
298         <dd>The total number of bytes received from the server. This number
299         is essentially the number of bytes sent over the wire.</dd>
300
301         <dt>HTML transferred</dt>
302         <dd>The total number of document bytes received from the server. This
303         number excludes bytes received in HTTP headers</dd>
304
305         <dt>Requests per second</dt>
306         <dd>This is the number of requests per second. This value is the result
307         of dividing the number of requests by the total time taken</dd>
308
309         <dt>Time per request</dt>
310         <dd>The average time spent per request. The first value is calculated
311         with the formula <code>concurrency * timetaken * 1000 / done</code>
312         while the second value is calculated with the formula
313         <code>timetaken * 1000 / done</code></dd>
314
315         <dt>Transfer rate</dt>
316         <dd>The rate of transfer as calculated by the formula
317         <code>totalread / 1024 / timetaken</code></dd>
318     </dl>
319 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
320 <div class="section">
321 <h2><a name="bugs" id="bugs">Bugs</a><a title="Permanent link" href="#bugs" class="permalink">&para;</a></h2>
322     <p>There are various statically declared buffers of fixed length. Combined
323     with the lazy parsing of the command line arguments, the response headers
324     from the server and other external inputs, this might bite you.</p>
325
326     <p>It does not implement HTTP/1.x fully; only accepts some 'expected' forms
327     of responses. The rather heavy use of <code>strstr(3)</code> shows up top
328     in profile, which might indicate a performance problem; <em>i.e.</em>, you
329     would measure the <code>ab</code> performance rather than the server's.</p>
330 </div></div>
331 <div class="bottomlang">
332 <p><span>Available Languages: </span><a href="../en/programs/ab.html" title="English">&nbsp;en&nbsp;</a> |
333 <a href="../fr/programs/ab.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
334 <a href="../ko/programs/ab.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
335 <a href="../tr/programs/ab.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
336 </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
337 <script type="text/javascript"><!--//--><![CDATA[//><!--
338 var comments_shortname = 'httpd';
339 var comments_identifier = 'http://httpd.apache.org/docs/trunk/programs/ab.html';
340 (function(w, d) {
341     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
342         d.write('<div id="comments_thread"><\/div>');
343         var s = d.createElement('script');
344         s.type = 'text/javascript';
345         s.async = true;
346         s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
347         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
348     }
349     else {
350         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
351     }
352 })(window, document);
353 //--><!]]></script></div><div id="footer">
354 <p class="apache">Copyright 2018 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
355 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
356 if (typeof(prettyPrint) !== 'undefined') {
357     prettyPrint();
358 }
359 //--><!]]></script>
360 </body></html>