wrk Multithreaded HTTP benchmarking with configurable connections and LuaJIT callbacks.
Overview wrk is a command-line HTTP benchmarking tool that combines multiple threads with event-driven network handling. It maintains a configured number of connections for a test duration and can use LuaJIT scripts to customize requests, responses and reporting.[2]
At a glance What does it offer? http benchmarking[2] What does it help people do? load test web services[2] ; measure http latency[2] What does it work with? http[2] ; luajit[2] What else affects its suitability? command line interface[2] Contents Threads, connections and duration The primary configuration separates the total connection count from the number of worker threads and the length of the run. Reported output includes request throughput and latency statistics. This makes wrk useful for a focused endpoint benchmark, but a connection count is a description of the generator rather than a direct count of human users or a complete model of application traffic.[2]
Lua customization Scripts can define setup, initialization, request, response and completion callbacks. Each worker has an independent scripting environment, while setup and completion use a separate environment. Request formatting and response inspection can support custom measurements, but shared state is not automatically available across every thread. Scripts need to respect those execution boundaries when combining results or assigning per-thread data.[3]
Measurement and scripting overhead The scripting reference warns that building requests repeatedly and parsing response headers or bodies adds cost. Pre-generating requests can reduce that work, while omitting a response callback avoids unnecessary parsing. The result summary separately exposes connection, read, write, status and timeout errors. Comparing runs should therefore preserve the script and its callbacks, not just the target URL and connection count. The project says static changes to the method, path, headers or body do not add this overhead; the cost comes from per-request work such as building each request or parsing each response.[3]
Resources and license The project notes that the generator needs enough ephemeral ports and that the target must handle the initial connection burst. Such infrastructure constraints can influence a benchmark independently of the application code being compared. The current repository labels its license Modified Apache 2.0, version 2.0.1; it should not be cataloged simply as an unmodified Apache-2.0 grant. Bundled components also have notices identified by the project.[1] [2]
Substitution scope wrk can substitute for hey for concise HTTP endpoint benchmarks where Lua request customization is useful. The tools expose different controls: hey documents a per-worker QPS cap, whereas wrk's core options emphasize threads, connections and duration. This is task overlap rather than interchangeable command syntax or identical load shape. A migration needs matched request behavior and error interpretation before throughput figures become comparable.[2] [3] [4]
wrk can substitute for wrk2 when the goal is an HTTP load test controlled by concurrent connections, threads and duration rather than a prescribed request arrival rate. Its Lua hooks can customize requests and reports, making it useful for that style of benchmark. This changes the experiment: wrk2 adds constant-throughput control and latency measurement against planned send times. Do not treat their latency distributions as interchangeable or use ordinary wrk results as proof of the same controlled-rate behavior.[2] [5]
Also included: 3 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.