- Notifications
You must be signed in to change notification settings - Fork0
hustshawn/docker-wrk
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A minimal docker image withWrk http benchmarking tool based onAlpine Linux (and optionally onDebian8)
Total image size is less then10mb
Repository name in Docker Hub:skandyla/wrk
Published viaautomated build mechanism
skandyla/wrk
(alpine/Dockerfile) - default image, based on Alpine 3.4
skandyla/wrk:debian8
(debian8/Dockerfile) - image, based on debian:jessie
$ docker pull skandyla/wrk
$ docker run --rm skandyla/wrk
$ docker run -it --rm --entrypoint=/bin/sh skandyla/wrk
$ docker run --rm -v $(pwd):/data skandyla/wrk -s \ script.lua https://www.example.com
Add custom records to /etc/hosts:
$ docker run --rm -v /etc/hosts:/etc/hosts \ skandyla/wrk -t5 -c10 -d30 https://www.example.com
wrk - a HTTP benchmarking tool
wrk is a modern HTTP benchmarking tool capable of generating significant
load when run on a single multi-core CPU. It combines a multithreaded
design with scalable event notification systems such as epoll and kqueue.
An optional LuaJIT script can perform HTTP request generation, response
processing, and custom reporting. Details are available in SCRIPTING and
several examples are located inscripts
Basic Usage:wrk -t12 -c400 -d30s http://127.0.0.1:8080/index.html
This runs a benchmark for 30 seconds, using 12 threads, and keeping400 HTTP connections open.
Output:
Running 30s test @ http://127.0.0.1:8080/index.html 12 threads and 400 connections Thread Stats Avg Stdev Max +/- Stdev Latency 635.91us 0.89ms 12.92ms 93.69% Req/Sec 56.20k 8.07k 62.00k 86.54% 22464657 requests in 30.00s, 17.76GB read Requests/sec: 748868.53 Transfer/sec: 606.33MB
LuaJIT script example:
script.lua:
-- example HTTP POST script which demonstrates setting the-- HTTP method, body, and adding a headerwrk.method="POST"wrk.body='{"value":"ourdata","type":"example"}'wrk.headers["X-EXAMPLE-HEADER"]="OurDataHeader"
Launch:wrk -t10 -c50 -d30s -s script.lua https://api.example.com
Load testing with wrk when every reqeust has unique http hmac authorization header