How to Benchmark HTTP Latency With Wrk.

No war in Ukraine. Stop Russia!

oleksii_y
4 min readDec 7, 2018

Preface.

Wrk is a modern HTTP benchmarking tool capable of generating significant load when running 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.

Wrk is useful for testing any website or application that relies on HTTP, such as:

  • Rails and other Ruby applications
  • Express and other JavaScript applications
  • PHP applications
  • Static websites running on web servers
  • Sites and applications behind load balancers like Nginx
  • Your caching layer

Tests can’t be compared to real users, but they should give you a good estimate of expected latency so you can better plan your infrastructure. Tests can also give you insight into your performance bottlenecks.

Step 1. Install Docker.

To make our lives easier we will use Docker, so we can start wrk inside a container. The saved time will be invested in learning wrk.

--

--