explaingit

wg/wrk

40,284CAudience · developerComplexity · 2/5DormantLicenseSetup · moderate

TLDR

HTTP benchmarking tool that simulates concurrent users hitting a web server to measure requests per second, latency, and performance limits.

Mindmap

mindmap
  root((wrk))
    What it does
      Simulates concurrent users
      Measures requests per second
      Reports latency percentiles
      Tracks data transferred
    How it works
      Multithreaded design
      Event notification systems
      LuaJIT scripting support
      Single-machine testing
    Use cases
      Test API performance
      Tune server configuration
      Compare framework performance
      Validate production readiness
    Tech stack
      C core
      LuaJIT scripting
      Multi-core CPU
    Audience
      Backend developers
      DevOps engineers
      System administrators

Things people build with this

USE CASE 1

Test whether your API can handle expected traffic loads before deploying to production.

USE CASE 2

Measure the effect of server configuration changes by running benchmarks before and after.

USE CASE 3

Compare performance of different web frameworks or server setups under identical load.

USE CASE 4

Validate that authentication, custom headers, and dynamic URLs work correctly under stress using Lua scripts.

Tech stack

CLuaJITPOSIX threads

Getting it running

Difficulty · moderate Time to first run · 30min

Requires C compiler and LuaJIT development headers; building from source needed.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

wrk is an HTTP benchmarking tool designed to measure how much load a web server can handle. The problem it solves is that developers and system administrators need to know the performance limits of their web applications before putting them in production or before making changes that could affect performance. wrk lets you simulate many concurrent users hitting your server at once and measures how many requests per second your server can process. The way it works is by running on a single multi-core CPU and using a multithreaded design with scalable event notification systems to maximize how many connections it can keep open simultaneously. You point it at a URL and tell it how many threads to use, how many connections to maintain, and how long to run the test. wrk then opens all those connections and hammers the server continuously for the specified duration, then reports statistics including the number of requests completed, requests per second, data transferred, and latency percentiles. It also supports scripting via LuaJIT, which means you can write small Lua scripts to customize request headers, dynamically generate different URLs, or add authentication tokens to your requests. You would use wrk if you are a developer who wants to test whether your web server or API can handle expected traffic loads, or if you are tuning server configuration and want to measure the effect of changes. It is popular for benchmarking web frameworks and comparing how different server setups perform under stress. The tech stack is C for the core tool, with LuaJIT embedded to provide the scripting extension layer.

Copy-paste prompts

Prompt 1
How do I use wrk to benchmark my Node.js API server running on localhost:3000 with 100 concurrent connections for 30 seconds?
Prompt 2
Write a Lua script for wrk that adds a Bearer token to every request and rotates through different user IDs in the URL path.
Prompt 3
I want to compare the performance of my Express server vs a Fastify server. What wrk command should I run and how do I interpret the results?
Prompt 4
How do I use wrk to test an endpoint that requires POST requests with JSON bodies instead of simple GET requests?
Prompt 5
What do the latency percentiles (p50, p95, p99) in wrk output mean, and how should I use them to identify performance problems?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.