Blame docs/manual/programs/ab.html.en

Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
Packit 90a5c9
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
Packit 90a5c9
Packit 90a5c9
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Packit 90a5c9
              This file is generated from xml source: DO NOT EDIT
Packit 90a5c9
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Packit 90a5c9
      -->
Packit 90a5c9
<title>ab - Apache HTTP server benchmarking tool - Apache HTTP Server Version 2.4</title>
Packit 90a5c9
<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
Packit 90a5c9
<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
Packit 90a5c9
<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" />
Packit 90a5c9
<script src="../style/scripts/prettify.min.js" type="text/javascript">
Packit 90a5c9
</script>
Packit 90a5c9
Packit 90a5c9
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
Packit 90a5c9
<body id="manual-page">
Packit 90a5c9

Modules | Directives | FAQ | Glossary | Sitemap

Packit 90a5c9

Apache HTTP Server Version 2.4

Packit 90a5c9
Packit 90a5c9
<-
Packit 90a5c9
Packit 90a5c9
Apache > HTTP Server > Documentation > Version 2.4 > Programs

ab - Apache HTTP server benchmarking tool

Packit 90a5c9
Packit 90a5c9

Available Languages:  en  |

Packit 90a5c9
 fr  |
Packit 90a5c9
 ko  |
Packit 90a5c9
 tr 

Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
    

ab is a tool for benchmarking your Apache Hypertext

Packit 90a5c9
    Transfer Protocol (HTTP) server. It is designed to give you an impression
Packit 90a5c9
    of how your current Apache installation performs. This especially shows
Packit 90a5c9
    you how many requests per second your Apache installation is capable of
Packit 90a5c9
    serving.

Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
  • Options
  • Packit 90a5c9
  • Output
  • Packit 90a5c9
  • Bugs
  • Packit 90a5c9

    See also

    Packit 90a5c9
    top
    Packit 90a5c9
    Packit 90a5c9

    Synopsis

    Packit 90a5c9
        

    ab

    Packit 90a5c9
        [ -A auth-username:password ]
    Packit 90a5c9
        [ -b windowsize ]
    Packit 90a5c9
        [ -B local-address ]
    Packit 90a5c9
        [ -c concurrency ]
    Packit 90a5c9
        [ -C cookie-name=value ]
    Packit 90a5c9
        [ -d ]
    Packit 90a5c9
        [ -e csv-file ]
    Packit 90a5c9
        [ -E client-certificate file ]
    Packit 90a5c9
        [ -f protocol ]
    Packit 90a5c9
        [ -g gnuplot-file ]
    Packit 90a5c9
        [ -h ]
    Packit 90a5c9
        [ -H custom-header ]
    Packit 90a5c9
        [ -i ]
    Packit 90a5c9
        [ -k ]
    Packit 90a5c9
        [ -l ]
    Packit 90a5c9
        [ -m HTTP-method ]
    Packit 90a5c9
        [ -n requests ]
    Packit 90a5c9
        [ -p POST-file ]
    Packit 90a5c9
        [ -P proxy-auth-username:password ]
    Packit 90a5c9
        [ -q ]
    Packit 90a5c9
        [ -r ]
    Packit 90a5c9
        [ -s timeout ]
    Packit 90a5c9
        [ -S ]
    Packit 90a5c9
        [ -t timelimit ]
    Packit 90a5c9
        [ -T content-type ]
    Packit 90a5c9
        [ -u PUT-file ]
    Packit 90a5c9
        [ -v verbosity]
    Packit 90a5c9
        [ -V ]
    Packit 90a5c9
        [ -w ]
    Packit 90a5c9
        [ -x <table>-attributes ]
    Packit 90a5c9
        [ -X proxy[:port] ]
    Packit 90a5c9
        [ -y <tr>-attributes ]
    Packit 90a5c9
        [ -z <td>-attributes ]
    Packit 90a5c9
        [ -Z ciphersuite ]
    Packit 90a5c9
        [http[s]://]hostname[:port]/path

    Packit 90a5c9
    top
    Packit 90a5c9
    Packit 90a5c9

    Options

    Packit 90a5c9
        
    Packit 90a5c9
        
    -A auth-username:password
    Packit 90a5c9
        
    Supply BASIC Authentication credentials to the server. The username and
    Packit 90a5c9
        password are separated by a single : and sent on the wire
    Packit 90a5c9
        base64 encoded. The string is sent regardless of whether the server needs
    Packit 90a5c9
        it (i.e., has sent an 401  authentication needed).
    Packit 90a5c9
    Packit 90a5c9
        
    -b windowsize
    Packit 90a5c9
        
    Size of TCP send/receive buffer, in bytes.
    Packit 90a5c9
    Packit 90a5c9
        
    -B local-address
    Packit 90a5c9
        
    Address to bind to when making outgoing connections.
    Packit 90a5c9
    Packit 90a5c9
        
    -c concurrency
    Packit 90a5c9
        
    Number of multiple requests to perform at a time. Default is one
    Packit 90a5c9
        request at a time.
    Packit 90a5c9
    Packit 90a5c9
        
    -C cookie-name=value
    Packit 90a5c9
        
    Add a Cookie: line to the request. The argument is
    Packit 90a5c9
        typically in the form of a name=value
    Packit 90a5c9
        pair. This field is repeatable.
    Packit 90a5c9
    Packit 90a5c9
        
    -d
    Packit 90a5c9
        
    Do not display the "percentage served within XX [ms] table". (legacy
    Packit 90a5c9
        support).
    Packit 90a5c9
    Packit 90a5c9
        
    -e csv-file
    Packit 90a5c9
        
    Write a Comma separated value (CSV) file which contains for each
    Packit 90a5c9
        percentage (from 1% to 100%) the time (in milliseconds) it took to serve
    Packit 90a5c9
        that percentage of the requests. This is usually more useful than the
    Packit 90a5c9
        'gnuplot' file; as the results are already 'binned'.
    Packit 90a5c9
    Packit 90a5c9
        
    -E client-certificate-file
    Packit 90a5c9
        
    When connecting to an SSL website, use the provided client certificate
    Packit 90a5c9
        in PEM format to authenticate with the server. The file is expected to
    Packit 90a5c9
        contain the client certificate, followed by intermediate certificates,
    Packit 90a5c9
        followed by the private key. Available in 2.4.36 and later.
    Packit 90a5c9
    Packit 90a5c9
        
    -f protocol
    Packit 90a5c9
        
    Specify SSL/TLS protocol (SSL2, SSL3, TLS1, TLS1.1, TLS1.2, or ALL).
    Packit 90a5c9
        TLS1.1 and TLS1.2 support available in 2.4.4 and later.
    Packit 90a5c9
    Packit 90a5c9
        
    -g gnuplot-file
    Packit 90a5c9
        
    Write all measured values out as a 'gnuplot' or TSV (Tab separate
    Packit 90a5c9
        values) file. This file can easily be imported into packages like Gnuplot,
    Packit 90a5c9
        IDL, Mathematica, Igor or even Excel. The labels are on the first line of
    Packit 90a5c9
        the file. 
    Packit 90a5c9
    Packit 90a5c9
        
    -h
    Packit 90a5c9
        
    Display usage information.
    Packit 90a5c9
    Packit 90a5c9
        
    -H custom-header
    Packit 90a5c9
        
    Append extra headers to the request. The argument is typically in
    Packit 90a5c9
        the form of a valid header line, containing a colon-separated field-value
    Packit 90a5c9
        pair (i.e., "Accept-Encoding: zip/zop;8bit").
    Packit 90a5c9
    Packit 90a5c9
        
    -i
    Packit 90a5c9
        
    Do HEAD requests instead of GET.
    Packit 90a5c9
    Packit 90a5c9
        
    -k
    Packit 90a5c9
        
    Enable the HTTP KeepAlive feature, i.e., perform multiple
    Packit 90a5c9
        requests within one HTTP session. Default is no KeepAlive.
    Packit 90a5c9
    Packit 90a5c9
        
    -l
    Packit 90a5c9
        
    Do not report errors if the length of the responses is not constant. This
    Packit 90a5c9
        can be useful for dynamic pages.
    Packit 90a5c9
        Available in 2.4.7 and later.
    Packit 90a5c9
        
    Packit 90a5c9
    Packit 90a5c9
        
    -m HTTP-method
    Packit 90a5c9
        
    Custom HTTP method for the requests.
    Packit 90a5c9
        Available in 2.4.10 and later.
    Packit 90a5c9
    Packit 90a5c9
        
    -n requests
    Packit 90a5c9
        
    Number of requests to perform for the benchmarking session. The default
    Packit 90a5c9
        is to just perform a single request which usually leads to
    Packit 90a5c9
        non-representative benchmarking results.
    Packit 90a5c9
    Packit 90a5c9
        
    -p POST-file
    Packit 90a5c9
        
    File containing data to POST. Remember to also set -T.
    Packit 90a5c9
    Packit 90a5c9
        
    -P proxy-auth-username:password
    Packit 90a5c9
        
    Supply BASIC Authentication credentials to a proxy en-route. The
    Packit 90a5c9
        username and password are separated by a single : and sent on
    Packit 90a5c9
        the  wire base64 encoded. The string is sent regardless of whether the
    Packit 90a5c9
        proxy needs it (i.e., has  sent an 407 proxy authentication
    Packit 90a5c9
        needed).
    Packit 90a5c9
    Packit 90a5c9
        
    -q
    Packit 90a5c9
        
    When processing more than 150 requests, ab outputs a
    Packit 90a5c9
        progress count on stderr every 10% or 100 requests or so. The
    Packit 90a5c9
        -q flag will suppress these messages.
    Packit 90a5c9
    Packit 90a5c9
        
    -r
    Packit 90a5c9
        
    Don't exit on socket receive errors.
    Packit 90a5c9
    Packit 90a5c9
        
    -s timeout
    Packit 90a5c9
        
    Maximum number of seconds to wait before the socket times out.
    Packit 90a5c9
        Default is 30 seconds.
    Packit 90a5c9
        Available in 2.4.4 and later.
    Packit 90a5c9
    Packit 90a5c9
        
    -S
    Packit 90a5c9
        
    Do not display the median and standard deviation values, nor display
    Packit 90a5c9
        the warning/error messages when the average and median are more than
    Packit 90a5c9
        one or two times the standard deviation apart. And default to the
    Packit 90a5c9
        min/avg/max values. (legacy support).
    Packit 90a5c9
    Packit 90a5c9
        
    -t timelimit
    Packit 90a5c9
        
    Maximum number of seconds to spend for benchmarking. This implies a
    Packit 90a5c9
        -n 50000 internally. Use this to benchmark the server within a
    Packit 90a5c9
        fixed total amount of time. Per default there is no timelimit.
    Packit 90a5c9
    Packit 90a5c9
        
    -T content-type
    Packit 90a5c9
        
    Content-type header to use for POST/PUT data, eg.
    Packit 90a5c9
        application/x-www-form-urlencoded.
    Packit 90a5c9
        Default is text/plain.
    Packit 90a5c9
    Packit 90a5c9
        
    -u PUT-file
    Packit 90a5c9
        
    File containing data to PUT. Remember to also set -T.
    Packit 90a5c9
    Packit 90a5c9
        
    -v verbosity
    Packit 90a5c9
        
    Set verbosity level - 4 and above prints information on
    Packit 90a5c9
        headers, 3 and above prints response codes (404, 200, etc.),
    Packit 90a5c9
        2 and above prints warnings and info.
    Packit 90a5c9
    Packit 90a5c9
        
    -V
    Packit 90a5c9
        
    Display version number and exit.
    Packit 90a5c9
    Packit 90a5c9
        
    -w
    Packit 90a5c9
        
    Print out results in HTML tables. Default table is two columns wide,
    Packit 90a5c9
        with a white background.
    Packit 90a5c9
    Packit 90a5c9
        
    -x <table>-attributes
    Packit 90a5c9
        
    String to use as attributes for <table>. Attributes
    Packit 90a5c9
        are inserted <table here >.
    Packit 90a5c9
    Packit 90a5c9
        
    -X proxy[:port]
    Packit 90a5c9
        
    Use a proxy server for the requests.
    Packit 90a5c9
    Packit 90a5c9
        
    -y <tr>-attributes
    Packit 90a5c9
        
    String to use as attributes for <tr>.
    Packit 90a5c9
    Packit 90a5c9
        
    -z <td>-attributes
    Packit 90a5c9
        
    String to use as attributes for <td>.
    Packit 90a5c9
    Packit 90a5c9
        
    -Z ciphersuite
    Packit 90a5c9
        
    Specify SSL/TLS cipher suite (See openssl ciphers)
    Packit 90a5c9
        
    Packit 90a5c9
    top
    Packit 90a5c9
    Packit 90a5c9

    Output

    Packit 90a5c9
        

    The following list describes the values returned by ab:

    Packit 90a5c9
        

    Packit 90a5c9
    Packit 90a5c9
        
    Packit 90a5c9
            
    Server Software
    Packit 90a5c9
            
    The value, if any, returned in the server HTTP header
    Packit 90a5c9
            of the first successful response. This includes all characters in the
    Packit 90a5c9
            header from beginning to the point a character with decimal value of 32
    Packit 90a5c9
            (most notably: a space or CR/LF) is detected.
    Packit 90a5c9
    Packit 90a5c9
            
    Server Hostname
    Packit 90a5c9
            
    The DNS or IP address given on the command line
    Packit 90a5c9
    Packit 90a5c9
            
    Server Port
    Packit 90a5c9
            
    The port to which ab is connecting. If no port is given on the
    Packit 90a5c9
            command line, this will default to 80 for http and 443 for
    Packit 90a5c9
            https.
    Packit 90a5c9
    Packit 90a5c9
            
    SSL/TLS Protocol
    Packit 90a5c9
            
    The protocol parameters negotiated between the client and server.
    Packit 90a5c9
            This will only be printed if SSL is used.
    Packit 90a5c9
    Packit 90a5c9
            
    Document Path
    Packit 90a5c9
            
    The request URI parsed from the command line string.
    Packit 90a5c9
    Packit 90a5c9
            
    Document Length
    Packit 90a5c9
            
    This is the size in bytes of the first successfully returned document.
    Packit 90a5c9
            If the document length changes during testing, the response is
    Packit 90a5c9
            considered an error.
    Packit 90a5c9
    Packit 90a5c9
            
    Concurrency Level
    Packit 90a5c9
            
    The number of concurrent clients used during the test
    Packit 90a5c9
    Packit 90a5c9
            
    Time taken for tests
    Packit 90a5c9
            
    This is the time taken from the moment the first socket connection
    Packit 90a5c9
            is created to the moment the last response is received
    Packit 90a5c9
    Packit 90a5c9
            
    Complete requests
    Packit 90a5c9
            
    The number of successful responses received
    Packit 90a5c9
    Packit 90a5c9
            
    Failed requests
    Packit 90a5c9
            
    The number of requests that were considered a failure. If the
    Packit 90a5c9
            number is greater than zero, another line will be printed showing the
    Packit 90a5c9
            number of requests that failed due to connecting, reading, incorrect
    Packit 90a5c9
            content length, or exceptions.
    Packit 90a5c9
    Packit 90a5c9
            
    Write errors
    Packit 90a5c9
            
    The number of errors that failed during write (broken pipe).
    Packit 90a5c9
    Packit 90a5c9
            
    Non-2xx responses
    Packit 90a5c9
            
    The number of responses that were not in the 200 series of response
    Packit 90a5c9
            codes. If all responses were 200, this field is not printed.
    Packit 90a5c9
    Packit 90a5c9
            
    Keep-Alive requests
    Packit 90a5c9
            
    The number of connections that resulted in Keep-Alive requests
    Packit 90a5c9
    Packit 90a5c9
            
    Total body sent
    Packit 90a5c9
            
    If configured to send data as part of the test, this is the total
    Packit 90a5c9
            number of bytes sent during the tests. This field is omitted if the test
    Packit 90a5c9
            did not include a body to send.
    Packit 90a5c9
    Packit 90a5c9
            
    Total transferred
    Packit 90a5c9
            
    The total number of bytes received from the server. This number
    Packit 90a5c9
            is essentially the number of bytes sent over the wire.
    Packit 90a5c9
    Packit 90a5c9
            
    HTML transferred
    Packit 90a5c9
            
    The total number of document bytes received from the server. This
    Packit 90a5c9
            number excludes bytes received in HTTP headers
    Packit 90a5c9
    Packit 90a5c9
            
    Requests per second
    Packit 90a5c9
            
    This is the number of requests per second. This value is the result
    Packit 90a5c9
            of dividing the number of requests by the total time taken
    Packit 90a5c9
    Packit 90a5c9
            
    Time per request
    Packit 90a5c9
            
    The average time spent per request. The first value is calculated
    Packit 90a5c9
            with the formula concurrency * timetaken * 1000 / done
    Packit 90a5c9
            while the second value is calculated with the formula
    Packit 90a5c9
            timetaken * 1000 / done
    Packit 90a5c9
    Packit 90a5c9
            
    Transfer rate
    Packit 90a5c9
            
    The rate of transfer as calculated by the formula
    Packit 90a5c9
            totalread / 1024 / timetaken
    Packit 90a5c9
        
    Packit 90a5c9
    top
    Packit 90a5c9
    Packit 90a5c9

    Bugs

    Packit 90a5c9
        

    There are various statically declared buffers of fixed length. Combined

    Packit 90a5c9
        with the lazy parsing of the command line arguments, the response headers
    Packit 90a5c9
        from the server and other external inputs, this might bite you.

    Packit 90a5c9
    Packit 90a5c9
        

    It does not implement HTTP/1.x fully; only accepts some 'expected' forms

    Packit 90a5c9
        of responses. The rather heavy use of strstr(3) shows up top
    Packit 90a5c9
        in profile, which might indicate a performance problem; i.e., you
    Packit 90a5c9
        would measure the ab performance rather than the server's.

    Packit 90a5c9
    Packit 90a5c9
    Packit 90a5c9

    Available Languages:  en  |

    Packit 90a5c9
     fr  |
    Packit 90a5c9
     ko  |
    Packit 90a5c9
     tr 

    Packit 90a5c9
    top

    Comments

    Notice:
    This is not a Q&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 mailing lists.
    Packit 90a5c9
    <script type="text/javascript">
    Packit 90a5c9
    var comments_shortname = 'httpd';
    Packit 90a5c9
    var comments_identifier = 'http://httpd.apache.org/docs/2.4/programs/ab.html';
    Packit 90a5c9
    (function(w, d) {
    Packit 90a5c9
        if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
    Packit 90a5c9
            d.write('
    <\/div>');
    Packit 90a5c9
            var s = d.createElement('script');
    Packit 90a5c9
            s.type = 'text/javascript';
    Packit 90a5c9
            s.async = true;
    Packit 90a5c9
            s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
    Packit 90a5c9
            (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
    Packit 90a5c9
        }
    Packit 90a5c9
        else { 
    Packit 90a5c9
            d.write('
    Comments are disabled for this page at the moment.<\/div>');
    Packit 90a5c9
        }
    Packit 90a5c9
    })(window, document);
    Packit 90a5c9
    //--></script>
    Packit 90a5c9

    Copyright 2018 The Apache Software Foundation.
    Licensed under the Apache License, Version 2.0.

    Packit 90a5c9

    Modules | Directives | FAQ | Glossary | Sitemap

    <script type="text/javascript">
    Packit 90a5c9
    if (typeof(prettyPrint) !== 'undefined') {
    Packit 90a5c9
        prettyPrint();
    Packit 90a5c9
    }
    Packit 90a5c9
    //--></script>
    Packit 90a5c9
    </body></html>