DEV Community

CloudGrains
CloudGrains

Posted on

Step-by-Step Guide: Installing wrk (HTTP Benchmarking Tool) on Amazon Linux

If you're working with auto-scaling, load testing, or performance tuning on AWS, then wrk is one of the most powerful yet lightweight benchmarking tools you can use.

However, Amazon Linux doesn’t provide wrk via yum, so you must build it from source.
In this guide, I’ll walk you through a clean and reliable installation process — perfect for EC2 users.

🧠 What Is wrk?
wrk is a modern HTTP benchmarking tool capable of generating significant load from a single machine.
It uses:

  • multithreading
  • event-driven architecture (epoll/kqueue)
  • Lua scripting for advanced testing
  • This makes it ideal for testing:
  • API performance
  • Auto-scaling groups
  • Load balancers
  • Backend throughput

✅ Prerequisites
You’ll need:

An Amazon Linux / Amazon Linux 2 EC2 instance

sudo access

Basic yum packages (which we install anyway)

🛠 Step-by-Step Instructions to Install wrk on Amazon Linux

1️⃣ Install Development Tools & Dependencies
Amazon Linux requires build tools to compile wrk:

sudo yum groupinstall -y "Development Tools"
sudo yum install -y git
Enter fullscreen mode Exit fullscreen mode

This installs:

  • gcc
  • make
  • automake
  • binutils
  • git
  • and other build dependencies

2️⃣ Clone the wrk Repository
Download the official wrk source code from GitHub:

git clone https://github.com/wg/wrk.git
cd wrk

This brings you into the project directory, ready for building.

3️⃣ Build wrk Using make
Compile:

make
Enter fullscreen mode Exit fullscreen mode

The process is fast — you'll get a binary named wrk inside the same folder.

4️⃣ Move wrk to Your PATH
Move the binary to a system-wide location such as /usr/local/bin:

sudo mv wrk /usr/local/bin/
Enter fullscreen mode Exit fullscreen mode

Now you can run wrk globally from any shell.

🎯 Final Command Summary
Here’s the complete installation sequence:

sudo yum groupinstall -y "Development Tools"
sudo yum install -y git
git clone https://github.com/wg/wrk.git
cd wrk
make
sudo mv wrk /usr/local/bin/
Enter fullscreen mode Exit fullscreen mode

🚀 How to Use wrk
Once installed, try generating load:

wrk -t12 -c400 -d30s http://your-server-endpoint/
Enter fullscreen mode Exit fullscreen mode

Explanation:

-t12 → number of threads

-c400 → number of open connections

-d30s → duration of test

URL → your target API or load balancer

🏁 Summary
Installing wrk on Amazon Linux is straightforward once you install development tools.
You simply:

Install build dependencies

Clone wrk

Compile it

Move the binary

After that, you can benchmark anything from APIs to auto-scaling groups with a single command.

Top comments (0)