Skip to content

Guide · Open source

How to use oha: run HTTP load tests from your terminal

Updated · written with AI from the project's own documentation and checked against our catalogue data

oha is a command-line tool that sends many HTTP requests to a web address and shows a live terminal display of progress and results. It is written in Rust and inspired by the older hey tool. This guide shows you how to install it, run a basic load test, and use the main options for request count, concurrency, duration and rate limiting.

ohahatoo/oha · ★ 10.7k · MIT

Quick start

  1. 1Install oha. Use your package manager, such as Homebrew, winget or pacman, or run cargo install oha if you have Rust installed.
  2. 2Pick a target URL. Choose a site or API you own or have permission to test. Heavy load can cause outages.
  3. 3Run a small test. Start with oha -n 200 followed by your URL to confirm the tool works and see the live display.
  4. 4Set request count and concurrency. Use -n for total requests and -c for concurrent connections, increasing them gradually.
  5. 5Limit the rate or set a duration. Use -z for a time window and -q for a queries-per-second cap.
  6. 6Read the output. Check the live display or use --no-tui for plain output, then compare results before and after a change.

Install oha on your system

The simplest route depends on your operating system. The README lists package-manager installs for Arch Linux, macOS with Homebrew and Windows with winget, and a Cargo install that works on any platform with Rust.

  • Arch Linux: pacman -S oha
  • macOS (Homebrew): brew install oha
  • Windows (winget): winget install hatoo.oha
  • Any platform with Rust: cargo install oha
cargo install oha

Build from source with Cargo

To install via Cargo, the README says you need stable Rust, plus make and cmake. The project also documents optional build features: native-tls instead of the default rustls, VSOCK support, and experimental HTTP/3 support through the vsock and http3 features.

If you want the Docker route, the README shows a local build with docker build and a run command that uses --network=host.

cargo install --no-default-features --features native-tls oha

Run your first load test

The basic form is oha followed by the target URL. Without other options, oha sends 200 requests using 50 concurrent connections, since those are the documented defaults. The live display updates while the test runs.

To control the size of the test, use -n for the number of requests and -c for concurrent connections. The -n option accepts suffixes, so 10k means 10,000 and 1m means 1,000,000. The README notes that you may need to raise your open-file limit for larger -c values.

  • -n sets the number of requests (default 200)
  • -c sets concurrent connections (default 50)
  • Use --no-tui if you prefer plain output
oha -n 10k -c 100 https://example.com

Test for a fixed duration or a set rate

Use -z to run for a time window, such as 10s or 3m. On HTTP/1, requests still in progress when the deadline hits are aborted and counted as aborted due to deadline, unless you add -w to wait for them. On HTTP/2, ongoing requests are waited for and -w is ignored.

To cap the load, use -q for a rate limit in queries per second. The README points out that -q is an overall rate across all workers, unlike hey, where it applies per worker. Add --latency-correction when you use -q or --burst-delay to correct for coordinated omission.

  • -z 30s runs for 30 seconds
  • -q 200 limits the total to 200 queries per second
  • --latency-correction is ignored unless -q or --burst-delay is set
oha -z 30s -q 200 https://example.com

Send POST requests, headers and HTTP/2 traffic

oha can set the HTTP method, add custom headers, send a request body, and choose the HTTP version. The README lists -m for the method, -H for headers, -d for an inline body, -D for a body read from a file, and --http2 as shorthand for HTTP/2.

For HTTP/2, -p sets parallel requests per connection. The README says oha runs c * p concurrent workers in total.

  • -m POST sets the method
  • -H "name: value" adds a header
  • -d or -D sets the body; -D reads it from a file
  • --http2 selects HTTP/2; -p sets parallel requests on HTTP/2
oha -m POST -H "Content-Type: application/json" -d '{"ping":true}' -n 1000 -c 20 https://example.com/api

Read the results and avoid common mistakes

oha is meant for load you have permission to generate. The README's own options include a request timeout (-t), a connect timeout that defaults to 5s, and a redirect limit (-r) that defaults to 0, so redirects are not followed unless you raise it.

Heavy load can cause outages, so run tests against staging or systems you own, and start with small numbers before scaling up.

  • Use -t to set a per-request timeout; the default is infinite
  • Use --no-color if your terminal output is hard to read or you pipe output
  • Use --disable-keepalive to stop reusing TCP connections (not supported on HTTP/2)

What people use it for

  • Checking how an API handles many simultaneous requests before a release
  • Comparing response behavior before and after a backend change
  • Testing a server over HTTP/2 with --http2 and -p
  • Sending a fixed rate of requests with -q to see behaviour at steady load
  • Running a short terminal-based test without a graphical tool

Frequently asked questions

Is oha free to use?

oha is released under the MIT licence, according to the project's listing. You can install it with the package managers and methods in this guide.

How do I install oha?

On Arch Linux run pacman -S oha, on macOS run brew install oha, and on Windows run winget install hatoo.oha. Anywhere with Rust, you can run cargo install oha.

What do I need to install oha with Cargo?

The README says you need stable Rust, with both make and cmake installed, to install via cargo. Pre-built binaries are also available from the project's release page.

How is oha different from hey?

oha is inspired by hey and adds a live terminal display. The -q option works differently: it sets an overall rate across all workers, not per worker as in hey.

What are good alternatives to oha?

The project lists hey, wrk, k6 and vegeta as comparable tools. Pick based on whether you want a live terminal view, scripted scenarios, or other features.

Why does my test stop early or show aborted requests?

On HTTP/1, when -z duration is reached, ongoing requests are aborted and counted as aborted due to deadline. Add -w to wait for them instead.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

oha suits developers and backend engineers who want a quick, terminal-based way to send load to a URL and watch results live, including rate limiting and HTTP/2 testing. It is not a fit if you need a graphical interface, scripted multi-step user journeys, or permission to load a live production system is missing; in those cases, consider tools like k6 instead.

Install options & downloads