What is Wrk?
wrk is an open-source HTTP benchmarking and load testing application. It was created by Will Glozer and is written in C with LuaJIT. wrk is designed to apply a specified user-configurable rate of requests to a target web application to measure performance.
Some key features and capabilities of wrk include:
- Lightweight and scalable - wrk runs on a single-thread using non-blocking I/O with an event loop. This allows it to generate significant load from a single CPU core while using minimal resources.
- Scriptable using LuaJIT - wrk comes with a built-in LuaJIT interpreter. This allows creating custom workloads and request sequences using scripts.
- Asynchronous operation - wrk uses non-blocking I/O with libuv allowing handling of thousands of connections with a single thread.
- Supports HTTP and HTTPS - wrk can benchmark both HTTP and HTTPS servers using keep-alive connections and pipelining of requests.
- Reporting of latency and throughput metrics - wrk provides detailed statistics on latency for various percentiles as well as requests/second handled by the target server.
wrk is commonly used by developers and DevOps teams for load testing, capacity planning and evaluating performance optimizations of web applications and microservices. Its lightweight nature combined with the ability to script workloads makes it well-suited for automation and CI/CD workflows.