ApacheBench HTTP load tester
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
ab -n 1000 -c 10 <url>
ab -k -n 5000 -c 50 <url>
ab -t 30 -c 20 <url>
ab -H "<header>" <url>
ab -p <file> -T <type> <url>
ab -A <user>:<pass> <url>
ab -r -n 1000 -c 100 <url>
ab -e <file.csv> <url>
Concepts
- -c clients open connections
- Server one URL, same request
- -n requests counted until done
- Report rps, time, percentiles
Running a test
ab [options] <url>
-n <requests>
-c <concurrency>
-t <seconds>
-k-s <seconds>
-r-l-i-m <method>
-B <address>
-b <bytes>
-V-hRequests
-H "<name: value>"
-C <name>=<value>
-p <file> -T <type>
-u <file> -T <type>
-T <content-type>
-A <user>:<pass>
-X <proxy>[:<port>]
-P <user>:<pass>
TLS
ab https://<host>/
-f <protocol>
-Z <ciphersuite>
-E <file.pem>
Reading output
| Line | Meaning |
|---|---|
| Requests per second | Total throughput (mean) |
| Time per request (1st) | Mean latency seen by one client |
| Time per request (2nd) | Mean across all concurrent clients |
| Failed requests | Connect, read, length errors |
| Non-2xx responses | Status outside 200-299 |
| Transfer rate | KB/s received |
| Percentage served | Latency percentiles in ms |
-e <file.csv>
-g <file.tsv>
-q-v <level>
-w-d-SRecipes
ab -n 1000 -c 10 -k http://localhost:8080/
echo '{"name":"x"}' > body.jsonab -n 500 -c 10 -p body.json -T application/json http://localhost:8080/items
ab -n 200 -c 5 -H "Authorization: Bearer <token>" https://example.test/api/me
ab -n 2000 -c 20 -g out.tsv http://localhost:8080/# gnuplot: plot "out.tsv" using 9 smooth sbezier with lines



