wrk - a HTTP benchmarking tool

Developer Tools

March 19th, 2021

wrk.jpg

During Taylor's Laracon Online presentation of Laravel Octane he used both Apache Bench, ab, and a tool named wrk that I'd never seen before.

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.

Once installed the basic usage is:

1wrk -t12 -c400 -d30s http://site.test

This runs a benchmark for 30 seconds (-d30s), using 12 threads (-t12), and keeping 400 (-c400) HTTP connections open. The output after running it looks something like this:

1Running 30s test @ http://site.test
2 12 threads and 400 connections
3 Thread Stats Avg Stdev Max +/- Stdev
4 Latency 635.91us 0.89ms 12.92ms 93.69%
5 Req/Sec 56.20k 8.07k 62.00k 86.54%
6 22464657 requests in 30.00s, 17.76GB read
7Requests/sec: 748868.53
8Transfer/sec: 606.33MB

If you are needing to do some benchmark testing check out wrk and it can even be installed via homebrew.

Filed in:

Eric L. Barnes

Eric is the creator of Laravel News and has been covering Laravel since 2012.