Load Testing Without the Headache: Meet oha
Ever needed to throw some serious traffic at your web app to see how it holds up, but dreaded setting up a complex load testing tool? You're not alone. Many of the classic tools feel like they're from a different era of the web—heavy, complicated, or wrapped in a SaaS paywall. Sometimes you just want a simple, scriptable command to answer the question: "Will this endpoint buckle under pressure?"
Enter oha, a modern, open-source HTTP load testing tool built for the command line. It's like finding a power drill that's both incredibly effective and surprisingly pleasant to use. It’s fast, it’s straightforward, and it gives you the clarity you need without the noise.
What It Does
oha is a CLI tool written in Rust that generates a high volume of HTTP requests to a target URL. You give it a web address, tell it how many connections and requests you want, and it floods the target while meticulously reporting back on how things are going. It measures all the critical metrics: total requests, success rate, latency distribution, and requests per second.
Think of it as ab (ApacheBench) but with a significant upgrade in features, usability, and performance.
Why It's Cool
So why reach for oha over other tools? A few things make it stand out:
- It's Seriously Fast: Being written in Rust and built on the async
tokioruntime,ohaitself has a tiny footprint and can generate a massive amount of load without breaking a sweat. This means the bottleneck is your application, not your testing tool. - Beautiful, Real-Time TUI: This is the killer feature for me. When you run a test,
ohapresents a clean, auto-refreshing terminal interface. You watch the requests-per-second counter climb, see the latency percentiles update live, and get an immediate visual sense of stability (or chaos). No more waiting for a final wall of text. - Practical Features Out of the Box: It includes things you immediately need: support for HTTP/1.1 and HTTP/2, the ability to set custom headers (great for auth tokens), a simple way to send a JSON body (
-nfor "no tui" mode is also handy for scripting). - Zero Fuss Installation: It's a single binary. Download it and run it. No dependencies, no runtime, no complicated setup.
How to Try It
Getting started takes about a minute. The easiest way is to grab the pre-built binary for your system from the GitHub Releases page.
For macOS users with Homebrew, it's even simpler:
brew install oha
Once installed, the basic syntax is clean:
oha http://localhost:8080/api/v1/status
To run a more substantial test—say, 1000 connections sending a total of 50,000 requests—you'd use:
oha -c 1000 -n 50000 http://your-test-endpoint.com
Want to test a POST request with some JSON?
oha -c 10 -n 1000 -m POST -T 'application/json' -d '{"key":"value"}' http://localhost:3000/api/create
Head over to the oha GitHub repository for the full rundown on all the flags and options.
Final Thoughts
oha has become my go-to first tool for any load testing. It's perfect for that quick sanity check during development, for CI/CD pipelines where you need a lightweight performance gate, or for anyone who prefers to stay in the terminal. It removes just enough friction to make load testing a casual part of your workflow, which is exactly where it should be.
Next time you deploy a new feature, consider firing up oha for a few seconds first. You might be surprised what you learn.
@githubprojects
Repository: https://github.com/hatoo/oha