wrk is a powerful tool used for performance and load testing, specifically designed for evaluating the performance of web servers that support HTTP and HTTPS. It sends requests to a target server under a specified load and measures response times, request counts, and other performance metrics to analyze overall performance.
Key Features of wrk
- High Performance: wrk can send a large volume of HTTP requests rapidly, making it ideal for simulating real-world traffic conditions.
- Flexible Configuration: Users can customize the load test by specifying connections, request rate, duration, and request content.
- Quick Installation: wrk is easy to install and typically runs from the command line.
- Advanced Metrics: wrk can record metrics such as time per request, transfer rate, and latency statistics.
Its flexibility makes wrk a preferred choice for developers and system administrators who want to understand and optimize server and application performance.
Installation
wrk, the process is straightforward and performed through the command line interface.Linux (Ubuntu)
- Open the terminal and run:
sudo apt-get update sudo apt-get install wrk
macOS
- Use Homebrew:
brew install wrk
Windows
- To use wrk on Windows, you may need WSL (Windows Subsystem for Linux). Steps:
- Install WSL: WSL Installation Guide
- Install Ubuntu or Debian via WSL
- Follow Linux installation instructions
Verify Installation
wrk --versionBasic wrk Command
wrk -t12 -c400 -d30s http://example.com-t: Number of threads (virtual users)-c: Number of connections-d: Duration of the test
Advanced Options
- Custom Request (Lua):
wrk -t12 -c400 -d30s -s script.lua http://example.comUse a Lua script to define custom HTTP requests.
- HTTP Headers:
wrk -t12 -c400 -d30s --header "Authorization: Bearer token" http://example.comAdd custom HTTP headers.
- Connection Timeout:
wrk -t12 -c400 -d30s --timeout 5s http://example.comSet maximum connection wait time.
- Latency Stats:
wrk -t12 -c400 -d30s --latency http://example.comShows detailed latency breakdown.
- Logging Output:
wrk -t12 -c400 -d30s -L http://example.comUseful for gnuplot processing.
Lua Script Example
wrk.method = "POST"
wrk.headers["Content-Type"] = "application/json"
wrk.body = '{"key": "value"}'Result Analysis
- Requests per Second (RPS) – number of processed requests
- Latency – response time per request
- Throughput – data transfer rate
- Concurrency – number of concurrent connections supported
10Gbps vs 1Gbps: Why Network Speed Matters in Load Testing
One of the most common mistakes when interpreting wrk results is assuming that the server or application is the bottleneck, while in reality the limitation may simply be the network bandwidth.
For example:
- 1Gbps network → ~125 MB/s max transfer
- 10Gbps network → ~1,250 MB/s max transfer
This means:
- a powerful server may appear slow on a 1Gbps test machine
- latency and RPS may flatten due to bandwidth saturation
- results may not reflect real server performance
For accurate benchmarking, always ensure the testing environment supports the expected throughput. This is where high-speed infrastructure such as a 10Gbps dedicated server becomes critical.
Examples
- Increased Thread Count:
wrk -t24 -c800 -d30s http://example.comTest with 24 threads and 800 connections.
- Longer Duration:
wrk -t12 -c400 -d60s http://example.comTest for 60 seconds instead of 30.
For more details, see the wrk GitHub Repository.
If your goal is to benchmark high-traffic environments realistically, consider using a testing setup with a 10Gbps dedicated server to avoid artificial bottlenecks.
FAQ
What is wrk used for?
wrk is a high-performance HTTP benchmarking tool used to measure web server throughput, latency, and concurrency under load.
Is wrk better than ApacheBench?
Yes. wrk can generate significantly more load thanks to its event-driven architecture, making it more suitable for modern high-traffic environments.
Can I run wrk on Windows?
wrk does not run natively on Windows. You need WSL or a Unix-like environment.
Why does bandwidth affect wrk results?
If your testing machine has limited bandwidth, it can become the bottleneck and prevent accurate performance measurement.





