TopGit
GitHub Repo Review

wrk: HTTP Benchmarking Tool

wg/wrk
WTopGit review image for wg/wrk
Review by Topgit.dev for wg/wrk, with GitHub repository stats and README context.
Quick verdict

wrk does exactly one thing well: it throws as much HTTP load at a single endpoint as one multi-core machine can generate, and prints latency percentiles that plain requests-per-second tools skip. There's no config file and no ramp-up logic — you get a handful of command-line flags and, if you need more, a LuaJIT escape hatch. That minimalism is the whole appeal: fast to run, fast to read, and it never pretends to be a full load-testing platform.

Stars
★ 40.4k
Forks
⑂ 3.0k
Language
C
License
See repository
Topic
—
Updated
Dec 2023
Homepage
—
GitHub

What is wrk?

wrk is a command-line HTTP benchmarking tool written in C that generates load against a single URL using a multithreaded design paired with epoll on Linux and kqueue on macOS. It can optionally run a LuaJIT script to customize request generation, response processing, and reporting. wrk targets a single multi-core machine rather than a distributed swarm of load generators.

Core features

  • ✓Multithreaded core that spreads connections across threads (-t), so a single multi-core box can generate serious concurrent load
  • ✓Event notification via epoll on Linux and kqueue on macOS, letting one process track thousands of open sockets without busy-waiting
  • ✓Optional LuaJIT scripting (-s) for custom request generation, response processing, and custom reporting, documented in the SCRIPTING file
  • ✓Example Lua scripts ship in the scripts/ directory to start from instead of writing one cold
  • ✓Custom HTTP header injection (-H) for adding auth tokens or other headers to every request without touching a script
  • ✓Detailed latency statistics (--latency) reporting average, standard deviation, max, and a distribution breakdown
  • ✓Timeout handling (--timeout) so a slow response registers as a failure instead of hanging the run
How this repository's GitHub stars have grown over time. Source: star-history.com.View the star history ↗

When to reach for wrk

  • •Load-testing a single API endpoint or static file on your own server before a traffic spike
  • •Comparing two server configurations (worker counts, keep-alive settings) by running the same wrk command against each
  • •Writing a LuaJIT script to simulate a login-then-fetch sequence when a flat GET/POST loop isn't representative
  • •Capturing latency percentiles for a performance regression check in CI, since --latency prints more than a bare req/sec number

Building and installing wrk from source

The README excerpt provided doesn't include a step-by-step build guide. What it does confirm: wrk is C source that bundles Mike Pall's LuaJIT, the nginx/joyent/node.js http-parser, and the 'ae' event loop from redis (per the Acknowledgements section and NOTICE file), so building it pulls in those components rather than shipping as a single standalone binary. Beyond that, the exact compiler invocation or make targets aren't clearly documented in what's given here.

Running a basic benchmark

Basic usage is one line: `wrk -t12 -c400 -d30s http://127.0.0.1:8080/index.html` runs a 30-second test with 12 threads holding 400 connections open. -t sets thread count, -c sets total connections (split evenly across threads), -d sets duration (accepts values like 2s, 2m, 2h), -s points at a LuaJIT script, -H adds a custom header such as 'User-Agent: wrk' to every request, --latency prints detailed latency statistics, and --timeout marks a response late if it doesn't arrive in time. The README's own sample run reports 22464657 requests in 30.00s, 17.76GB read, a Requests/sec of 748868.53, and Transfer/sec of 606.33MB — your numbers will depend entirely on the target and hardware.

Strengths

  • ✓A single self-contained binary once built — no server-side agent, no SaaS dashboard, just wrk and a target URL
  • ✓Multithreaded design with epoll/kqueue means it can generate load close to what a multi-core client machine is actually capable of, instead of being bottlenecked by one thread
  • ✓LuaJIT scripting covers the cases flags can't — per-request headers, non-GET workflows, custom reporting — without switching tools
  • ✓Reports latency percentiles (avg/stdev/max plus a distribution with --latency) instead of just a bare requests-per-second number

Known limitations and gotchas

  • △The README excerpt gives no install/build walkthrough, so you're figuring out the compiler and dependency setup (LuaJIT, http-parser) yourself
  • △Command-line only — there's no config file, so multi-scenario test plans mean shell scripting around wrk or writing LuaJIT
  • △Per-request Lua logic (building a new request or calling response()) measurably reduces the load wrk itself can generate, per the README's own benchmarking tips
  • △Saturating a server requires tuning the client machine's ephemeral ports and socket reuse yourself — an OS-level chore wrk doesn't handle for you
  • △No license is stated in the metadata provided, and the README's Cryptography Notice flags export-control considerations for the bundled crypto code

Alternative HTTP benchmarking tools

Apache Bench (ab) — ships with the Apache HTTP Server project, single-threaded, and the long-standing default many developers already have installedhey — a single Go binary with no build step, closer to wrk's spirit of a quick CLI benchmark but without LuaJIT scriptingsiege — adds concurrent-user simulation from a URL list, useful for hitting multiple endpoints in one run instead of onevegeta — built around a fixed request rate rather than max throughput, better suited to 'can my server sustain N req/sec' than 'how fast can it go'

Frequently asked questions

Can wrk script custom HTTP requests with LuaJIT?

wrk supports scripting custom HTTP requests through an optional LuaJIT script passed via the -s flag, which can also process responses and produce custom reports. Example scripts ship in the scripts/ directory, and full scripting details live in the project's SCRIPTING documentation.

What event notification systems does wrk use on Linux and macOS?

wrk uses epoll for event notification on Linux and kqueue on macOS, both wrapped into its multithreaded design so a single process can track large numbers of open connections without polling each one individually.

Does wrk support HTTPS and TLS benchmarking?

wrk's README doesn't spell this out directly, but it states that the distribution includes cryptographic software, classified under U.S. export control as ECCN 5D002.C.1 in the Cryptography Notice — confirming wrk ships with code for hitting https:// targets, even without detailed TLS options in the docs.

What latency statistics does wrk report?

wrk reports average, standard deviation, and maximum latency per thread by default, and the --latency flag adds a fuller distribution breakdown. The README's own sample run shows figures like 635.91us average latency and a 12.92ms max, alongside a '+/- Stdev' column.

How many connections and threads can wrk handle on a single CPU?

wrk's README doesn't state a hard maximum for connections or threads — it describes wrk as capable of generating significant load from a single multi-core CPU via its multithreaded design plus epoll/kqueue. The docs' example runs 12 threads and 400 connections, but that's a sample, not a documented ceiling.

Why does wrk need so many ephemeral ports?

wrk opens one outbound TCP connection per client connection it simulates, and each consumes an ephemeral port on the machine running wrk. The project's own benchmarking tips note the client needs enough ephemeral ports available and needs closed sockets recycled quickly, or you run out before the server becomes the bottleneck.

The problem it solves

Most developers reach for an ad hoc curl loop or a heavyweight distributed load-testing platform when they just want to know how many requests per second their own server can handle before something on the client falls over. wrk sits in between: a single C binary that pushes real concurrent load from one machine and reports latency percentiles, without the setup cost of a cluster tool or the crudeness of a bash loop.

Who should try it — and who should skip

Try wrk if you're comfortable building from source and living in flags-and-Lua territory to get a raw throughput and latency read on your own API or static file server. Skip it if you want a GUI, a hosted dashboard, or a tool that ships a ready binary and a config file out of the box — wrk assumes you'd rather write six lines of LuaJIT than click through a wizard.

Source & attribution

Facts and quotes sourced from the wg/wrk GitHub repository (https://github.com/wg/wrk), including its README, referenced SCRIPTING documentation, and Acknowledgements/NOTICE sections.

GitHub data · last synced Aug 15, 2026Reviewed by Henry
← Back to TopGit

Curious whether wrk is right for you?

Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about wrk.

GitHub