Sign inSign up

jhasensio/wrk

By jhasensio

•Updated 7 months ago

Image
0

859

jhasensio/wrk repository overview

⁠jhasensio/wrk:

High-Performance HTTP Benchmarking

⁠Overview

This repository provides an ultra-minimal, high-performance containerized version of wrk, a modern HTTP benchmarking tool capable of generating significant load from a single multi-core CPU.

Unlike hping3 (which tests Layer 4 raw throughput), wrk tests Layer 7 (Application) limits. It combines a multithreaded design with scalable event notification systems like epoll and kqueue.

Technical Implementation: Built using a multi-stage Alpine Dockerfile, this image compiles the latest wrk source code statically with its bundled LuaJIT, resulting in a production-ready footprint of ~3MB. It natively supports HTTPS and SNI (Server Name Indication).


⁠🚀 Performance Optimization (Host OS)

When running wrk at high concurrency, the bottleneck is rarely CPU or memory; it is TCP Port Exhaustion. Because wrk opens and closes thousands of full HTTP connections per second, your host machine will run out of ephemeral ports (getting stuck in the TIME_WAIT state).

To achieve maximum Requests-Per-Second (RPS), run these tuning commands on your physical host before launching the container:

# 1. Allow the kernel to reuse ports stuck in TIME_WAIT
sudo sysctl -w net.ipv4.tcp_tw_reuse=1

# 2. Expand the range of available local ports
sudo sysctl -w net.ipv4.ip_local_port_range="1024 65535"

# 3. Increase the maximum socket backlog
sudo sysctl -w net.core.somaxconn=65535

Tag summary

Content type

Image

Digest

sha256:aba22719a…

Size

6 MB

Last updated

7 months ago

docker pull jhasensio/wrk