ApacheBench (ab)
ApacheBench (ab) is a simple, ubiquitous command-line HTTP benchmark reporting requests per second, per-request time, and a latency percentile table. It is single-threaded and basic, best for quick sanity checks.
ApacheBench, invoked as ab, is a minimalist command-line tool for benchmarking HTTP servers. Distributed with the Apache HTTP Server, it is almost universally available and ideal for a fast, no-setup sanity check of an endpoint's throughput. Its simplicity is both its appeal and its limitation: a single short command produces a useful first read, but the tool was never designed for sophisticated load modeling.
What It Measures
ab reports requests per second, time per request (both the mean across all requests and the mean per concurrent request), transfer rate in kilobytes per second, and a connection-time breakdown showing how long connect, processing, and waiting phases take. It also prints a percentage table showing the response time below which a given share of requests completed, for example 95 percent under a certain millisecond figure, giving a basic latency distribution that is more informative than the average alone.
Methodology
A run specifies the total number of requests and the concurrency level, for example ten thousand requests at one hundred concurrent connections against a URL. ab opens the requested number of simultaneous connections and issues requests until the total is reached, timing each one. It supports custom headers, POST and PUT bodies from a file, basic authentication, cookies, and HTTP keep-alive. Crucially, it is single-threaded, so a single ab process is limited by one CPU core, which caps how much load it can generate against a fast server.
How to Interpret Results
Read requests per second for raw throughput and the percentage table for latency distribution; the 99 percent line is the practical tail-latency indicator. Higher throughput and lower per-request time are better. Because ab is single-threaded and closed-loop, treat it as a quick comparative probe, not a definitive load test. If results plateau unexpectedly, confirm ab itself is not the bottleneck by checking client CPU; a saturated client understates the server. Run several times to smooth variance, since a single short run can be noisy.
Limitations
ab is single-threaded, so it cannot saturate fast modern servers from one process and tends to underrepresent true capacity. It tests a single URL with simple patterns, not multi-step scenarios, sessions, or dynamic data correlation. It suffers from coordinated omission, understating tail latency under load because it waits for slow responses. It does not run browser JavaScript or model think time. Use ab for quick checks and rough comparisons during development; move to wrk, k6, Gatling, or JMeter for serious, high-load, or scenario-based testing.