ab
TLDR
Benchmark a URL with 100 requests using 10 concurrent connections
SYNOPSIS
ab [-n requests] [-c concurrency] [-t timelimit] [options] URL
DESCRIPTION
ab (Apache Benchmark) is a command-line tool for benchmarking HTTP servers. It generates load by sending multiple requests to a specified URL and measures server response times, throughput, and other performance metrics.
The tool reports statistics including requests per second, time per request, transfer rate, and connection times broken down by percentiles. It supports both HTTP and HTTPS, custom headers, POST data, cookies, and HTTP authentication.
PARAMETERS
-n requests
Number of requests to perform for the benchmarking session-c concurrency
Number of multiple requests to perform at a time (simultaneous connections)-t timelimit
Maximum number of seconds to spend benchmarking (implies -n 50000)-k
Enable HTTP KeepAlive feature (persistent connections)-p file
File containing data to POST-T content-type
Content-type header for POST/PUT data-H header
Append extra header to the request (repeatable)-A auth
HTTP Basic Authentication credentials (user:password)-C cookie
Add a Cookie header (name=value)-s timeout
Maximum seconds to wait for each response (default 30)-v verbosity
Verbosity level (1-4)
CAVEATS
ab creates synthetic load that may not reflect real-world traffic patterns. It does not parse HTML or execute JavaScript, so it only tests raw HTTP performance. Results can be misleading if the server implements rate limiting or caching. For more realistic load testing, consider tools like wrk, siege, or k6.
HISTORY
ab was created as part of the Apache HTTP Server project in the late 1990s. It was designed as a simple benchmarking tool for testing Apache configurations during development. The tool has remained largely unchanged and is bundled with Apache HTTPD installations worldwide.


