AB(1)
๐ฆ ab, manual section 1 ๐ฆ
okay bestie, this is the manual for ab, the Apache benchmarking tool ๐
โจ NAME โจ
ab - Apache HTTP server benchmarking tool ๐ฅ
๐ SYNOPSIS ๐
ab [ -A auth-username:password ] [ -b windowsize ] [ -B local-address ]
[ -c concurrency ] [ -C cookie-name=value ] [ -d ] [ -e csv-file ] [ -E
client-certificate file ] [ -f protocol ] [ -g gnuplot-file ] [ -h ] [
-H custom-header ] [ -i ] [ -k ] [ -l ] [ -m HTTP-method ] [ -n requests
] [ -p POST-file ] [ -P proxy-auth-username:password ] [ -q ] [ -r ] [
-s timeout ] [ -S ] [ -t timelimit ] [ -T content-type ] [ -u PUT-file ]
[ -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes ] [ -X
proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes ] [ -Z
ciphersuite ] [http[s]://]hostname[:port]/path
๐ SUMMARY ๐
okay so ab is the tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server ๐ It's designed to give you a vibe check on how your current Apache install performs. Lowkey the big flex here is that it shows you how many requests per second your Apache install is capable of serving โจ
๐ฆ OPTIONS ๐ฆ
-A auth-username:passwordโ Slide in with BASIC Authentication credentials for the server ๐ The username and password are separated by a single:and sent on the wire base64 encoded. The string gets sent no matter whether the server actually needs it (i.e., it hasn't sent a 401 authentication needed).-b windowsizeโ Sets the size of the TCP send/receive buffer, in bytes ๐ฆ-B local-addressโ The address to bind to when making outgoing connections ๐ธ-c concurrencyโ How many multiple requests to perform at a time ๐ง The default is one request at a time.-C cookie-name=valueโ Adds aCookie:line to the request ๐ช The argument is typically aname=valuepair. This one is repeatable, so go wild ๐-dโ Skip displaying the"percentage served within XX [ms] table"๐ (legacy support).-e csv-fileโ Writes a Comma separated value (CSV) file with, 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 thegnuplotfile, bc the results are alreadybinned.-E client-certificate-fileโ When connecting to an SSL website, use the provided client certificate in PEM format to authenticate with the server ๐ The file should hold the client certificate, then the intermediate certificates, then the private key. Available in 2.4.36 and later.-f protocolโ Pick your SSL/TLS protocol: SSL2, SSL3, TLS1, TLS1.1, TLS1.2, or ALL ๐ TLS1.1 and TLS1.2 support is available in 2.4.4 and later.-g gnuplot-fileโ Writes all measured values out as agnuplotor TSV (Tab separate values) file ๐ It can easily be imported into packages like Gnuplot, IDL, Mathematica, Igor or even Excel. The labels are on the first line of the file.-hโ Shows the usage info ๐ง-H custom-headerโ Appends extra headers to the request ๐ The argument is typically a valid header line with a colon-separated field-value pair (i.e.,"Accept-Encoding: zip/zop;8bit").-iโ Does HEAD requests instead of GET ๐ฆ-kโ Turns on the HTTP KeepAlive feature, i.e., multiple requests within one HTTP session ๐ซถ The default is no KeepAlive.-lโ Doesn't report errors if the length of the responses isn't constant ๐ธ This can be useful for dynamic pages. Available in 2.4.7 and later.-m HTTP-methodโ Custom HTTP method for the requests ๐ Available in 2.4.10 and later.-n requestsโ The 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 results ๐-p POST-fileโ The file containing data to POST ๐ฎ Remember to also set-T.-P proxy-auth-username:passwordโ Slide in with BASIC Authentication credentials for a proxy en-route ๐ The username and password are separated by a single:and sent on the wire base64 encoded. The string gets sent no matter whether the proxy needs it (i.e., it hasn't sent a 407 proxy authentication needed).-qโ When processing more than 150 requests,aboutputs a progress count on stderr every 10% or 100 requests or so ๐ The-qflag suppresses these messages, so you can stop the spam ๐คซ-rโ Don't exit on socket receive errors ๐-s timeoutโ The maximum number of seconds to wait before the socket times out โฐ The default is 30 seconds. Available in 2.4.4 and later.-Sโ Skips the median and standard deviation values, and also skips the warning/error messages when the average and median are more than one or two times the standard deviation apart ๐ It defaults to the min/avg/max values instead. (legacy support).-t timelimitโ The maximum number of seconds to spend benchmarking โณ This implies a-n 50000internally. Use this to benchmark the server within a fixed total amount of time. By default there's no timelimit.-T content-typeโ The Content-type header to use for POST/PUT data, eg.application/x-www-form-urlencoded๐ The default istext/plain.-u PUT-fileโ The file containing data to PUT ๐ค Remember to also set-T.-v verbosityโ Sets the verbosity level ๐ Level 4 and above prints info on headers, 3 and above prints response codes (404, 200, etc.), and 2 and above prints warnings and info.-Vโ Shows the version number and exits ๐-wโ Prints results in HTML tables ๐ The default table is two columns wide, with a white background.-x <table>-attributesโ A string to use as attributes for<table>๐ The attributes get inserted into the<table here >tag.-X proxy[:port]โ Uses a proxy server for the requests ๐ฆ-y <tr>-attributesโ A string to use as attributes for<tr>๐ซง-z <td>-attributesโ A string to use as attributes for<td>๐ซง-Z ciphersuiteโ Specifies the SSL/TLS cipher suite (Seeopenssl ciphers) ๐
๐ OUTPUT ๐
okay here's the tea on every value ab hands back ๐ต
- Server Software โ The value (if any) from the server HTTP header of the first successful response ๐ฅ๏ธ It includes every character from the start up until a character with decimal value 32 (most notably: a space or CR/LF) shows up.
- Server Hostname โ The DNS or IP address you typed on the command line ๐
- Server Port โ The port
abis connecting to ๐ If you didn't give a port on the command line, it defaults to 80 for http and 443 for https. - SSL/TLS Protocol โ The protocol parameters negotiated between the client and server ๐ This only gets printed if SSL is used.
- Document Path โ The request URI parsed from the command line string ๐ฃ๏ธ
- Document Length โ The size in bytes of the first successfully returned document ๐ If the document length changes during testing, the response is considered an error ๐
- Concurrency Level โ The number of concurrent clients used during the test ๐ง
- Time taken for tests โ The time from the moment the first socket connection is created to the moment the last response is received โฑ๏ธ
- Complete requests โ The number of successful responses received โ
- Failed requests โ The number of requests that were considered a failure โ If that number is greater than zero, another line gets printed showing how many requests failed due to connecting, reading, incorrect content length, or exceptions.
- Write errors โ The number of errors that failed during write (broken pipe) ๐
- Non-2xx responses โ The number of responses that weren't in the 200 series of response codes ๐ If all responses were 200, this field isn't printed.
- Keep-Alive requests โ The number of connections that resulted in Keep-Alive requests ๐ซถ
- Total body sent โ If you configured it to send data as part of the test, this is the total number of bytes sent during the tests ๐ค This field is omitted if the test didn't include a body to send.
- Total transferred โ The total number of bytes received from the server ๐ฅ This number is essentially the number of bytes sent over the wire.
- HTML transferred โ The total number of document bytes received from the server ๐ This number excludes bytes received in HTTP headers.
- Requests per second โ The number of requests per second ๐ This value is the result of dividing the number of requests by the total time taken.
- Time per request โ The average time spent per request โฒ๏ธ The first value is calculated with the formula
concurrency * timetaken * 1000 / done, while the second value is calculated with the formulatimetaken * 1000 / done. - Transfer rate โ The rate of transfer, calculated by the formula
totalread / 1024 / timetaken๐
๐ BUGS ๐
okay bestie, real talk, there are some known bugs ๐
There are various statically declared buffers of fixed length. Combined with the lazy parsing of the command line arguments, the response headers from the server and other external inputs, this might bite you ๐ฌ
It does not implement HTTP/1.x fully; it only accepts some'expected'forms of responses ๐ The rather heavy use ofstrstr(3)shows up top in the profile, which might indicate a performance problem; i.e., you would end up measuring theabperformance rather than the server's ๐ซ
Stay benchmarking, bestie! ๐๐โจ
This page is from the Apache HTTP Server, dated 2026-04-30 ๐๐ซถ
๐ฆ where this page comes from
- alpine 3.22: apache2-doc 2.4.69-r0 ยท Apache-2.0
- alpine 3.23: apache2-doc 2.4.69-r0 ยท Apache-2.0
- alpine 3.24: apache2-doc 2.4.69-r0 ยท Apache-2.0
- arch rolling: apache 2.4.69-1 ยท Apache-2.0
- debian bookworm: apache2-utils 2.4.68-1~deb12u1 ยท Apache-2.0
- debian trixie: apache2-utils 2.4.68-1~deb13u1 ยท Apache-2.0
- debian trixie: apache2-utils 2.4.69-1~deb13u1 ยท Apache-2.0
- fedora 43: httpd-tools 2.4.68-1.fc43
- fedora 43: httpd-tools 2.4.69-1.fc43 ยท Apache-2.0 AND (BSD-3-Clause AND metamail AND HPND-sell-variant AND Spencer-94)
- fedora 44: httpd-tools 2.4.69-1.fc44 ยท Apache-2.0 AND (BSD-3-Clause AND metamail AND HPND-sell-variant AND Spencer-94)
- nixpkgs unstable: apache-httpd 2.4.69
- ubuntu stonking: apache2-utils 2.4.68-1ubuntu4 ยท Apache-2.0
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms