hammer-load
v0.1.2
Published
HTTP load generator with coordinated-omission-corrected latency
Maintainers
Readme
hammer-load
An HTTP load generator that does not lie about tail latency.
Most load generators quietly under-report p99. When the server stalls, a closed-loop generator sends nothing during the stall, so the requests that would have queued behind it are never issued, never timed, and never appear in the histogram — it omits exactly the samples that mattered. hammer measures latency from when each request should have departed, and ships both measurements so you can see the difference on your own server.
npm install -g hammer-load
hammer -c 50 -t 4 -d 30 --rate 20000 --latency http://localhost:8080/Installing downloads a prebuilt binary for Linux x86_64, macOS arm64 or Windows x86_64 and verifies its SHA-256. If there is no prebuilt binary for your platform it builds from source, which needs CMake 3.21+ and a C++20 compiler.
The point
hammer -c 20 -t 4 -d 10 --rate 2000 --latency http://127.0.0.1:8080/ # corrected
hammer -c 20 -t 4 -d 10 --rate 2000 --latency --closed-loop http://127.0.0.1:8080/ # what most tools reportSame server, same schedule, same 20,000 requests — only the stopwatch differs:
| percentile | corrected | closed loop | |-----------:|----------:|------------:| | 90% | 45.25ms | 414.46us | | 99% | 182.19ms | 3.78ms | | max | 211.81ms | 210.98ms |
A closed-loop tool reports 3.78ms at p99 and you conclude the service is healthy. The corrected number is 182ms. Nothing about the server changed between those columns.
Options
-c, --connections N total connections (default 50)
-t, --threads N worker threads (default 4)
-d, --duration S test duration in seconds (default 10)
-r, --rate N target req/s; turns on open-loop mode
--closed-loop measure from actual send even with --rate set
-m, --method M HTTP method (default GET)
-H, --header "K: V" extra header, repeatable
--body FILE request body from file
--timeout MS per-request timeout (default 2000)
--latency print the full percentile spectrum
--json machine-readable output
--version, -h, --helpNo HTTPS, no HTTP/2, no redirects. The sockets, the HTTP parsing and the HDR histogram are all hand-written — no libcurl, no boost.
Full documentation, design notes and the reasoning behind the comparison: https://github.com/AroseEditor/hammer
