Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Wrk http benchmarking tool in minimal Alpine docker image

NotificationsYou must be signed in to change notification settings

hustshawn/docker-wrk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Summary

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

Images, tags and respective Dockerfile links

Installation

$ docker pull skandyla/wrk

Usage

Show usage

$ docker run --rm skandyla/wrk

To login inside the container (optional)

$ docker run -it --rm  --entrypoint=/bin/sh skandyla/wrk

Script example

$ docker run --rm -v $(pwd):/data skandyla/wrk -s \  script.lua  https://www.example.com

Custom hosts entries example

Add custom records to /etc/hosts:

$ docker run --rm -v /etc/hosts:/etc/hosts \  skandyla/wrk -t5 -c10 -d30  https://www.example.com

Wrk mini-howto

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

Useful info

Load testing with wrk when every reqeust has unique http hmac authorization header

About

Wrk http benchmarking tool in minimal Alpine docker image

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp