HttpArena
Knowledge BaseFrameworks

wrk: TLS Static File and JSON Load Generator

wrk is a multi-threaded HTTP benchmarking tool used for the two URI-rotating HTTP/1.1 + TLS profiles: static-tls and json-tls. Both run against port 8081.

Why wrk for these profiles?

Both profiles run over TLS, and gcannon speaks plaintext HTTP/1.1 only. wrk handles TLS itself and rotates URIs with a small Lua script.

For the static files there is a second reason. The 20 files have response sizes from 3 KB to 67 KB (brotli-compressed). At these sizes, gcannon's io_uring provided buffer ring path introduces per-completion overhead that limits throughput to ~14 GB/s on loopback. wrk's simpler epoll + read() approach achieves ~19 GB/s on the same workload, ensuring the load generator is never the bottleneck.

For small-response plaintext tests (baseline, pipelined, JSON compression), gcannon's io_uring batched submission is faster than wrk. The tools complement each other.

Lua rotation scripts

ScriptProfileWhat it rotates
requests/static-rotate.luastatic-tlsAll 20 static file paths, each request with Accept-Encoding: br;q=1, gzip;q=0.8
requests/json-tls-rotate.luajson-tlsSeven /json/{count}?m={m} pairs, no Accept-Encoding

The static rotation looks like this:

request = function()
  counter = counter + 1
  local path = paths[((counter - 1) % 20) + 1]
  return wrk.format("GET", path, {["Accept-Encoding"] = ae_header})
end

Latency

wrk prints average and maximum latency but no percentiles unless run with --latency. The harness records wrk's maximum latency in the p99 column for these two profiles, so read it as a worst case rather than a percentile.

Parameters

ParameterValue
Test profilesstatic-tls, json-tls
Port8081 (HTTP/1.1 over TLS)
Threads64
Connections1,024 (static-tls), 4,096 (json-tls)
Duration5s
Runs3 (best taken)