LLMpediaThe first transparent, open encyclopedia generated by LLMs

wrk

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Xdebug Hop 4
Expansion Funnel Raw 72 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted72
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
wrk
Namewrk
AuthorJohn W. O'Connor
DeveloperWesley David
Released2012
Programming languageC (programming language)
Operating systemLinux, macOS, FreeBSD
GenreBenchmark (computing)
LicenseMIT License

wrk

wrk is a modern HTTP benchmarking tool designed to generate significant load for web servers and measure throughput, latency, and error rates. Originally created to stress-test HTTP and HTTPS endpoints, wrk integrates a scalable multithreaded engine with a LuaJIT-based scripting interface to simulate complex request patterns against targets such as NGINX, Apache HTTP Server, and Caddy (web server). It is widely used alongside load-testing suites like Siege (software), ab (ApacheBench), and JMeter for capacity planning and performance tuning.

Overview

wrk is an open-source load generator focused on producing high request-per-second workloads using asynchronous I/O and user-space event loops. The project rose to prominence in benchmarking discussions involving NGINX performance comparisons, Lighttpd, and custom HTTP/1.1 server implementations. It supports TLS via platform libraries and is frequently cited in performance analyses alongside platforms such as Node.js, Go (programming language), Rust (programming language), and web frameworks like Express (web framework), Django, Ruby on Rails, and ASP.NET Core.

Features

wrk combines a small core written in C (programming language) with an embedded scripting layer based on Lua (programming language) and LuaJIT. Key features include: - High-concurrency generation through multiple threads and a scalable event loop; used to stress servers like HAProxy, Envoy (software), and Traefik. - Scripting hooks for request customization, latency measurements, and response parsing via Lua (programming language), enabling simulation of APIs like those behind GraphQL, REST (representational state transfer), or gRPC gateways (when proxied over HTTP). - Support for TLS endpoints commonly provided by OpenSSL, LibreSSL, or BoringSSL stacks present in deployments of Kubernetes, Docker (software), and Amazon Web Services services. - Measurements of requests per second, transfer rates, socket errors, and latency histograms comparable to outputs from wrk2, Locust (software), and Gatling (software).

Usage

Typical usage involves invoking wrk from command lines on Linux or macOS systems to generate traffic against servers such as NGINX or IIS. Common invocation patterns include specifying thread counts, connection counts, test duration, and Lua scripts to generate request bodies for endpoints implemented in Spring Framework, Flask (web framework), or Phoenix (framework). In continuous integration pipelines orchestrated via Jenkins, GitLab CI/CD, or GitHub Actions, wrk is often used to validate performance regressions after changes in projects like Kubernetes controllers, Envoy (software) proxies, or Istio service mesh policies. Administrators monitor metrics in backends like Prometheus, Graphite, and InfluxDB when correlating wrk results with system telemetry from Linux tools such as perf (Linux), htop, and iostat.

Performance and Benchmarks

Benchmarks produced with wrk have been influential in evaluating web server and framework throughput under realistic loads. Comparative studies often juxtapose wrk results for NGINX vs Apache HTTP Server or Lighttpd and for language runtimes such as V8 (JavaScript engine), HotSpot (virtual machine), and interpreters used by PHP. Because wrk generates high levels of concurrent connections, its measurements are sensitive to kernel tuning parameters like those exposed by sysctl and tools used for kernel-space networking such as ethtool and tc (Linux utility). Researchers and engineers pair wrk with packet-capture tools such as tcpdump and Wireshark to analyze anomalies and validate hypotheses about bottlenecks in stacks including Redis, PostgreSQL, and MySQL when web services hit backend resources.

Implementation and Architecture

The core of wrk is implemented in C (programming language) and relies on non-blocking sockets, platform-specific event mechanisms such as epoll on Linux and kqueue on FreeBSD/macOS, and efficient memory handling to sustain millions of requests per test. The embedded Lua (programming language) runtime allows test authors to implement custom request generation, response validation, and dynamic header manipulation for services interacting with identity systems such as OAuth 2.0 and OpenID Connect providers. Wrk’s architecture emphasizes single-process multithreading with per-thread event loops to avoid locking overhead, a model echoed in high-performance projects like Nginx Unit and HAProxy.

Alternatives and Comparison

Popular alternatives to wrk include ab (ApacheBench), Siege (software), JMeter, Locust (software), Gatling (software), k6 (software), and wrk2. Each tool targets different use cases: ab (ApacheBench) for simple HTTP load, JMeter for complex protocol scenarios, Locust (software) for distributed Python-driven tests, and k6 (software) for developer-friendly scripting with JavaScript. wrk is distinguished by its lightweight C core, Lua (programming language) extensibility, and emphasis on raw throughput, making it a common choice when comparing server technologies like NGINX, Apache HTTP Server, Caddy (web server), and application runtimes such as Node.js, Go (programming language), and Rust (programming language).

Category:Benchmarking software