AB(1)

๐Ÿ“ฆ
version 2.4.69 ยท 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, ubuntu stonking

๐Ÿฆ‹ 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 a Cookie: line to the request ๐Ÿช The argument is typically a name=value pair. 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 the gnuplot file, bc the results are already binned.
  • -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 a gnuplot or 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, ab outputs a progress count on stderr every 10% or 100 requests or so ๐Ÿ™„ The -q flag 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 50000 internally. 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 is text/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 (See openssl 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 ab is 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 formula timetaken * 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 of strstr(3) shows up top in the profile, which might indicate a performance problem; i.e., you would end up measuring the ab performance 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