substitutefor

software · Q45

wrk

Multithreaded HTTP benchmarking with configurable connections and LuaJIT callbacks.

Suggest a correction

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]

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]

Capabilities & limitations

Threaded HTTP benchmarks

supported

Configured connections are distributed across worker threads for a timed run.[2]

Focused HTTP endpoint benchmarking · epoll/kqueue-based systems · Version, plan and platform requirements apply

1 source · check evidence
https://github.com/wg/wrk/blob/master/README.md

Thread/connection model and scripting overhead

vendor · checked 2026-10-07

Lua request and reporting hooks

supported

Independent worker environments provide lifecycle callbacks.[3]

Focused HTTP endpoint benchmarking · epoll/kqueue-based systems · Version, plan and platform requirements apply

1 source · check evidence
https://github.com/wg/wrk/blob/master/SCRIPTING

Independent thread environments, request callbacks and errors

vendor · checked 2026-10-07

Low-overhead custom processing

limited

Per-request generation and response parsing reduce available generator capacity.[2][3]

Focused HTTP endpoint benchmarking · epoll/kqueue-based systems · Version, plan and platform requirements apply

2 sources · check evidence
https://github.com/wg/wrk/blob/master/README.md

Thread/connection model and scripting overhead

vendor · checked 2026-10-07
https://github.com/wg/wrk/blob/master/SCRIPTING

Independent thread environments, request callbacks and errors

vendor · checked 2026-10-07

Can substitute for

These are products or services this entry can replace. Check the task and limitations for each comparison.

hey for Focused HTTP endpoint benchmarking

limited

Can replace focused HTTP benchmarks with thread/connection controls and Lua hooks; pacing semantics and scripts differ.[2][4]

epoll/kqueue-based systems · Version, plan and platform requirements apply

wrk2 for Concurrent-connection HTTP load testing

limited

Useful when concurrency-driven loading is the intended experiment; not an equivalent substitute for wrk2 constant-rate arrivals or planned-time latency accounting.[2][5]

epoll/kqueue-based systems · Unspecified

References

  1. wrk license

    Modified Apache 2.0 version 2.0.1

    vendor · retrieved 2026-10-07
  2. wrk documentation

    Thread/connection model and scripting overhead

    vendor · retrieved 2026-10-07
  3. wrk Lua scripting API

    Independent thread environments, request callbacks and errors

    vendor · retrieved 2026-10-07
  4. hey documentation

    Worker-level QPS, duration/request count, HTTP2 and platforms

    vendor · retrieved 2026-10-07
  5. wrk2 workload and latency model

    Constant-throughput option, planned-time latency measurement and relationship to wrk

    vendor · retrieved 2026-10-10
  6. https://github.com/wg/wrk/blob/master/README.md

    Thread/connection load model, test duration and LuaJIT scripting

    assessment · retrieved 2026-10-10

Discussion & disputes

Ask about unclear claims or explain a concern with supporting sources. If you have a specific fix, suggest a correction.

No discussion yet.

Sign in with an active account to join the discussion.

Revision history

Open a revision to read an earlier version of this article.

RevisionTimestampEdit summary
16362026-10-19 14:50:05/* wbeditentity-statements-multiple-properties-update:0||2 */ sf:5cbfb50f-ec40-4c1b-a169-f565af22d807:v2 | Add wrk as a substitute for wrk2 for concurrent-connection HTTP load testing, with an explicit distinction from constant-rate arrivals and planned-time latency | attribution: /proposals/5cbfb50f-ec40-4c1b-a169-f565af22d807
292026-10-08 23:11:56/* wbeditentity-create-item:0| */ sf:01bd4edc-073f-483f-98cd-78ecf1af41c8:v2 | Add wrk with cited product identity, workflow and portability boundaries; documentation research only. | attribution: /proposals/01bd4edc-073f-483f-98cd-78ecf1af41c8