High-throughput HTTP server for load testing. It responds with a tiny JSON body and is optimized for maximum requests per second (RPS) under heavy pipelining.
Response format
HTTP/1.1 200 OK- Body:
{"r":<0..9999>}with a random value per request
This server uses a minimal HTTP parser to count \r\n\r\n boundaries, which is intentionally fast and sufficient for benchmarking.
- Extremely fast response path using precomputed HTTP responses
- Keeps connections alive and supports aggressive pipelining
- Lightweight per-second RPS logging
- Simple, dependency-free Go codebase
- Go 1.25+
- macOS or Linux
go build -o server .
./serverThe server listens on :8007.
The server prints a startup line and then logs RPS once per second:
2026/02/03 13:02:10 rps=7571783 total=76440064
If running in the background, a common pattern is:
./server >/tmp/fast-metrics.log 2>&1 &
tail -f /tmp/fast-metrics.logpipeline.lua is included and uses an aggressive pipeline size.
wrk --latency -t12 -c 1000 -d 10s -s pipeline.lua http://127.0.0.1:8007/metricsTo push higher RPS, run multiple wrk processes in parallel:
for i in 1 2 3 4; do
wrk -t12 -c 1000 -d 10s -s pipeline.lua http://127.0.0.1:8007/metrics &
done
waitIf your system restricts access to the default Go build cache, run:
GOCACHE=/tmp/go-build go test ./...- This server is designed for performance testing, not full HTTP compliance.
- The response payload is intentionally minimal to maximize throughput.