{
    "mode": "man",
    "parameter": "AB",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/AB/1/json",
    "generated": "2026-06-13T22:55:52Z",
    "synopsis": "ab  [ -A auth-username:password ] [ -b windowsize ] [ -B local-address ] [ -c concurrency ] [\n-C cookie-name=value ] [ -d ] [ -e csv-file ] [ -E client-certificate file ] [ -f protocol  ]\n[  -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k ] [ -l ] [ -m HTTP-method ] [ -n\nrequests ] [ -p POST-file ] [ -P proxy-auth-username:password ] [ -q ] [ -r ] [ -s timeout  ]\n[  -S  ] [ -t timelimit ] [ -T content-type ] [ -u PUT-file ] [ -v verbosity] [ -V ] [ -w ] [\n-x <table>-attributes ] [ -X proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes  ]  [\n-Z ciphersuite ] [http[s]://]hostname[:port]/path",
    "sections": {
        "NAME": {
            "content": "ab - Apache HTTP server benchmarking tool\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ab  [ -A auth-username:password ] [ -b windowsize ] [ -B local-address ] [ -c concurrency ] [\n-C cookie-name=value ] [ -d ] [ -e csv-file ] [ -E client-certificate file ] [ -f protocol  ]\n[  -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k ] [ -l ] [ -m HTTP-method ] [ -n\nrequests ] [ -p POST-file ] [ -P proxy-auth-username:password ] [ -q ] [ -r ] [ -s timeout  ]\n[  -S  ] [ -t timelimit ] [ -T content-type ] [ -u PUT-file ] [ -v verbosity] [ -V ] [ -w ] [\n-x <table>-attributes ] [ -X proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes  ]  [\n-Z ciphersuite ] [http[s]://]hostname[:port]/path\n\n\n",
            "subsections": []
        },
        "SUMMARY": {
            "content": "ab  is  a  tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is\ndesigned to give you an impression of how your current Apache installation performs. This es‐\npecially  shows you how many requests per second your Apache installation is capable of serv‐\ning.\n\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-A",
                    "content": "Supply BASIC Authentication credentials to the server. The username and  password  are\nseparated  by  a  single : and sent on the wire base64 encoded. The string is sent re‐\ngardless of whether the server needs it (i.e., has sent an 401 authentication needed).\n",
                    "flag": "-A"
                },
                {
                    "name": "-b",
                    "content": "Size of TCP send/receive buffer, in bytes.\n",
                    "flag": "-b"
                },
                {
                    "name": "-B",
                    "content": "Address to bind to when making outgoing connections.\n",
                    "flag": "-B"
                },
                {
                    "name": "-c",
                    "content": "Number of multiple requests to perform at a time. Default is one request at a time.\n",
                    "flag": "-c"
                },
                {
                    "name": "-C",
                    "content": "Add a Cookie: line to the request.  The  argument  is  typically  in  the  form  of  a\nname=value pair. This field is repeatable.\n",
                    "flag": "-C"
                },
                {
                    "name": "-d",
                    "content": "",
                    "flag": "-d"
                },
                {
                    "name": "-e",
                    "content": "Write  a  Comma separated value (CSV) file which contains for each percentage (from 1%\nto 100%) the time (in milliseconds) it took to serve that percentage of the  requests.\nThis  is  usually  more  useful  than  the  'gnuplot' file; as the results are already\n'binned'.\n",
                    "flag": "-e"
                },
                {
                    "name": "-E",
                    "content": "When connecting to an SSL website, use the provided client certificate in  PEM  format\nto  authenticate  with the server. The file is expected to contain the client certifi‐\ncate, followed by intermediate certificates, followed by the private key. Available in\n2.4.36 and later.\n",
                    "flag": "-E"
                },
                {
                    "name": "-f",
                    "content": "Specify SSL/TLS protocol (SSL2, SSL3, TLS1, TLS1.1, TLS1.2, or ALL). TLS1.1 and TLS1.2\nsupport available in 2.4.4 and later.\n",
                    "flag": "-f"
                },
                {
                    "name": "-g",
                    "content": "Write all measured values out as a 'gnuplot' or TSV (Tab separate values)  file.  This\nfile can easily be imported into packages like Gnuplot, IDL, Mathematica, Igor or even\nExcel. The labels are on the first line of the file.\n",
                    "flag": "-g"
                },
                {
                    "name": "-h",
                    "content": "",
                    "flag": "-h"
                },
                {
                    "name": "-H",
                    "content": "Append extra headers to the request. The argument is typically in the form of a  valid\nheader  line,  containing  a colon-separated field-value pair (i.e., \"Accept-Encoding:\nzip/zop;8bit\").\n",
                    "flag": "-H"
                },
                {
                    "name": "-i",
                    "content": "",
                    "flag": "-i"
                },
                {
                    "name": "-k",
                    "content": "session. Default is no KeepAlive.\n",
                    "flag": "-k"
                },
                {
                    "name": "-l",
                    "content": "ful for dynamic pages. Available in 2.4.7 and later.\n",
                    "flag": "-l"
                },
                {
                    "name": "-m",
                    "content": "Custom HTTP method for the requests. Available in 2.4.10 and later.\n",
                    "flag": "-m"
                },
                {
                    "name": "-n",
                    "content": "Number of requests to perform for the benchmarking session. The  default  is  to  just\nperform  a  single  request which usually leads to non-representative benchmarking re‐\nsults.\n",
                    "flag": "-n"
                },
                {
                    "name": "-p",
                    "content": "File containing data to POST. Remember to also set -T.\n",
                    "flag": "-p"
                },
                {
                    "name": "-P",
                    "content": "Supply BASIC Authentication credentials to a proxy en-route. The username and password\nare  separated  by  a single : and sent on the wire base64 encoded. The string is sent\nregardless of whether the proxy needs it (i.e., has sent an 407  proxy  authentication\nneeded).\n",
                    "flag": "-P"
                },
                {
                    "name": "-q",
                    "content": "10% or 100 requests or so. The -q flag will suppress these messages.\n",
                    "flag": "-q"
                },
                {
                    "name": "-r",
                    "content": "",
                    "flag": "-r"
                },
                {
                    "name": "-s",
                    "content": "Maximum number of seconds to wait before the socket times out. Default is 30  seconds.\nAvailable in 2.4.4 and later.\n",
                    "flag": "-s"
                },
                {
                    "name": "-S",
                    "content": "messages when the average and median are more than one or two times the standard devi‐\nation apart. And default to the min/avg/max values. (legacy support).\n",
                    "flag": "-S"
                },
                {
                    "name": "-t",
                    "content": "Maximum  number  of  seconds to spend for benchmarking. This implies a -n 50000 inter‐\nnally. Use this to benchmark the server within a fixed total amount of time.  Per  de‐\nfault there is no timelimit.\n",
                    "flag": "-t"
                },
                {
                    "name": "-T",
                    "content": "Content-type  header  to use for POST/PUT data, eg. application/x-www-form-urlencoded.\nDefault is text/plain.\n",
                    "flag": "-T"
                },
                {
                    "name": "-u",
                    "content": "File containing data to PUT. Remember to also set -T.\n",
                    "flag": "-u"
                },
                {
                    "name": "-v",
                    "content": "Set verbosity level - 4 and above prints information on headers, 3  and  above  prints\nresponse codes (404, 200, etc.), 2 and above prints warnings and info.\n",
                    "flag": "-v"
                },
                {
                    "name": "-V",
                    "content": "",
                    "flag": "-V"
                },
                {
                    "name": "-w",
                    "content": "background.\n",
                    "flag": "-w"
                },
                {
                    "name": "-x",
                    "content": "String to use as attributes for <table>. Attributes are inserted <table here >.\n",
                    "flag": "-x"
                },
                {
                    "name": "-X",
                    "content": "Use a proxy server for the requests.\n",
                    "flag": "-X"
                },
                {
                    "name": "-y",
                    "content": "String to use as attributes for <tr>.\n",
                    "flag": "-y"
                },
                {
                    "name": "-z",
                    "content": "String to use as attributes for <td>.\n",
                    "flag": "-z"
                },
                {
                    "name": "-Z",
                    "content": "Specify SSL/TLS cipher suite (See openssl ciphers)\n\n",
                    "flag": "-Z"
                }
            ]
        },
        "OUTPUT": {
            "content": "The following list describes the values returned by ab:\n\n\n\nServer Software\nThe value, if any, returned in the server HTTP header  of  the  first  successful  re‐\nsponse. This includes all characters in the header from beginning to the point a char‐\nacter with decimal value of 32 (most notably: a space or CR/LF) is detected.\n\nServer Hostname\nThe DNS or IP address given on the command line\n\nServer Port\nThe port to which ab is connecting. If no port is given on the command line, this will\ndefault to 80 for http and 443 for https.\n\nSSL/TLS Protocol\nThe  protocol  parameters  negotiated between the client and server. This will only be\nprinted if SSL is used.\n\nDocument Path\nThe request URI parsed from the command line string.\n\nDocument Length\nThis is the size in bytes of the first successfully returned document. If the document\nlength changes during testing, the response is considered an error.\n\nConcurrency Level\nThe number of concurrent clients used during the test\n\nTime taken for tests\nThis  is  the time taken from the moment the first socket connection is created to the\nmoment the last response is received\n\nComplete requests\nThe number of successful responses received\n\nFailed requests\nThe number of requests that were considered a failure. If the number is  greater  than\nzero,  another  line will be printed showing the number of requests that failed due to\nconnecting, reading, incorrect content length, or exceptions.\n\nWrite errors\nThe number of errors that failed during write (broken pipe).\n\nNon-2xx responses\nThe number of responses that were not in the 200 series of response codes. If all  re‐\nsponses were 200, this field is not printed.\n\nKeep-Alive requests\nThe number of connections that resulted in Keep-Alive requests\n\nTotal body sent\nIf configured to send data as part of the test, this is the total number of bytes sent\nduring the tests. This field is omitted if the test did not include a body to send.\n\nTotal transferred\nThe total number of bytes received from the server. This  number  is  essentially  the\nnumber of bytes sent over the wire.\n\nHTML transferred\nThe  total  number  of  document  bytes received from the server. This number excludes\nbytes received in HTTP headers\n\nRequests per second\nThis is the number of requests per second. This value is the result  of  dividing  the\nnumber of requests by the total time taken\n\nTime per request\nThe  average  time  spent  per request. The first value is calculated with the formula\nconcurrency * timetaken * 1000 / done while the second value is  calculated  with  the\nformula timetaken * 1000 / done\n\nTransfer rate\nThe rate of transfer as calculated by the formula totalread / 1024 / timetaken\n\n",
            "subsections": []
        },
        "BUGS": {
            "content": "There are various statically declared buffers of fixed length. Combined with the lazy parsing\nof the command line arguments, the response headers from the server and  other  external  in‐\nputs, this might bite you.\n\n\nIt  does  not  implement HTTP/1.x fully; only accepts some 'expected' forms of responses. The\nrather heavy use of strstr(3) shows up top in profile, which  might  indicate  a  performance\nproblem; i.e., you would measure the ab performance rather than the server's.\n\n\n\n\nApache HTTP Server                           2018-10-10                                        AB(1)",
            "subsections": []
        }
    },
    "summary": "ab - Apache HTTP server benchmarking tool",
    "flags": [
        {
            "flag": "-A",
            "long": null,
            "arg": null,
            "description": "Supply BASIC Authentication credentials to the server. The username and password are separated by a single : and sent on the wire base64 encoded. The string is sent re‐ gardless of whether the server needs it (i.e., has sent an 401 authentication needed)."
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": "Size of TCP send/receive buffer, in bytes."
        },
        {
            "flag": "-B",
            "long": null,
            "arg": null,
            "description": "Address to bind to when making outgoing connections."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "Number of multiple requests to perform at a time. Default is one request at a time."
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": "Add a Cookie: line to the request. The argument is typically in the form of a name=value pair. This field is repeatable."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "Write a Comma separated value (CSV) file which contains for each percentage (from 1% to 100%) the time (in milliseconds) it took to serve that percentage of the requests. This is usually more useful than the 'gnuplot' file; as the results are already 'binned'."
        },
        {
            "flag": "-E",
            "long": null,
            "arg": null,
            "description": "When connecting to an SSL website, use the provided client certificate in PEM format to authenticate with the server. The file is expected to contain the client certifi‐ cate, followed by intermediate certificates, followed by the private key. Available in 2.4.36 and later."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "Specify SSL/TLS protocol (SSL2, SSL3, TLS1, TLS1.1, TLS1.2, or ALL). TLS1.1 and TLS1.2 support available in 2.4.4 and later."
        },
        {
            "flag": "-g",
            "long": null,
            "arg": null,
            "description": "Write all measured values out as a 'gnuplot' or TSV (Tab separate values) file. This file can easily be imported into packages like Gnuplot, IDL, Mathematica, Igor or even Excel. The labels are on the first line of the file."
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-H",
            "long": null,
            "arg": null,
            "description": "Append extra headers to the request. The argument is typically in the form of a valid header line, containing a colon-separated field-value pair (i.e., \"Accept-Encoding: zip/zop;8bit\")."
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-k",
            "long": null,
            "arg": null,
            "description": "session. Default is no KeepAlive."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "ful for dynamic pages. Available in 2.4.7 and later."
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "Custom HTTP method for the requests. Available in 2.4.10 and later."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to non-representative benchmarking re‐ sults."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "File containing data to POST. Remember to also set -T."
        },
        {
            "flag": "-P",
            "long": null,
            "arg": null,
            "description": "Supply BASIC Authentication credentials to a proxy en-route. The username and password are separated by a single : and sent on the wire base64 encoded. The string is sent regardless of whether the proxy needs it (i.e., has sent an 407 proxy authentication needed)."
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": "10% or 100 requests or so. The -q flag will suppress these messages."
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "Maximum number of seconds to wait before the socket times out. Default is 30 seconds. Available in 2.4.4 and later."
        },
        {
            "flag": "-S",
            "long": null,
            "arg": null,
            "description": "messages when the average and median are more than one or two times the standard devi‐ ation apart. And default to the min/avg/max values. (legacy support)."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "Maximum number of seconds to spend for benchmarking. This implies a -n 50000 inter‐ nally. Use this to benchmark the server within a fixed total amount of time. Per de‐ fault there is no timelimit."
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": "Content-type header to use for POST/PUT data, eg. application/x-www-form-urlencoded. Default is text/plain."
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "File containing data to PUT. Remember to also set -T."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "Set verbosity level - 4 and above prints information on headers, 3 and above prints response codes (404, 200, etc.), 2 and above prints warnings and info."
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-w",
            "long": null,
            "arg": null,
            "description": "background."
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": "String to use as attributes for <table>. Attributes are inserted <table here >."
        },
        {
            "flag": "-X",
            "long": null,
            "arg": null,
            "description": "Use a proxy server for the requests."
        },
        {
            "flag": "-y",
            "long": null,
            "arg": null,
            "description": "String to use as attributes for <tr>."
        },
        {
            "flag": "-z",
            "long": null,
            "arg": null,
            "description": "String to use as attributes for <td>."
        },
        {
            "flag": "-Z",
            "long": null,
            "arg": null,
            "description": "Specify SSL/TLS cipher suite (See openssl ciphers)"
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Apache HTTP server benchmarking tool.",
        "examples": [
            {
                "description": "Execute 100 HTTP GET requests to a given URL",
                "command": "ab -n 100 {{url}}"
            },
            {
                "description": "Execute 100 HTTP GET requests, in concurrent batches of 10, to a URL",
                "command": "ab -n 100 -c 10 {{url}}"
            },
            {
                "description": "Execute 100 HTTP POST requests to a URL, using a JSON payload from a file",
                "command": "ab -n 100 -T {{application/json}} -p {{path/to/file.json}} {{url}}"
            },
            {
                "description": "Use HTTP [k]eep-Alive, i.e. perform multiple requests within one HTTP session",
                "command": "ab -k {{url}}"
            },
            {
                "description": "Set the maximum number of seconds ([t]imeout) to spend for benchmarking (30 by default)",
                "command": "ab -t {{60}} {{url}}"
            },
            {
                "description": "Write the results to a CSV file",
                "command": "ab -e {{path/to/file.csv}}"
            }
        ]
    }
}