Vegeta — HTTP Load Testing Tool at Constant Request Rates
Fast Go HTTP load generator that sustains a precise constant request rate and emits HDR histograms, JSON reports, and latency plots.
What it is
Vegeta is a Go-based HTTP load testing tool that attacks endpoints at a precise constant request rate. Unlike tools that ramp up connections until the server breaks, Vegeta maintains the rate you specify and measures how the server responds. It produces HDR histograms, JSON reports, latency distributions, and visual plots.
Vegeta targets backend engineers, SREs, and performance testers who need reproducible load tests with accurate latency measurements.
How it saves time or tokens
Vegeta's constant-rate approach produces more meaningful results than burst-based tools. You know exactly how many requests per second were sent, making it easy to compare runs and identify regressions. The CLI piping model (attack | encode | report) is composable and scriptable.
Vegeta is a single binary with zero dependencies. No JVM, no config files, no cluster setup.
How to use
- Install Vegeta:
go install github.com/tsenart/vegeta@latestorbrew install vegeta - Create a targets file with HTTP endpoints
- Run an attack at a specified rate
- Generate reports from the results
Example
# Attack at 100 requests/second for 30 seconds
echo 'GET https://api.example.com/health' | \
vegeta attack -rate=100 -duration=30s | \
vegeta report
# Output:
# Requests [total, rate, throughput] 3000, 100.03, 99.97
# Duration [total, attack, wait] 30.01s, 29.99s, 12.1ms
# Latencies [min, mean, 50, 90, 95, 99, max] 2.1ms, 12.3ms, 10.1ms, 22.4ms, 35.6ms, 89.2ms, 210.1ms
# Success [ratio] 99.87%
# Status Codes [code:count] 200:2996 500:4
# Generate a latency plot
echo 'GET https://api.example.com/health' | \
vegeta attack -rate=100 -duration=30s | \
vegeta plot > latency.html
# Multiple endpoints with headers
cat <<EOF | vegeta attack -rate=50 -duration=10s | vegeta report
GET https://api.example.com/users
Authorization: Bearer token123
POST https://api.example.com/orders
Content-Type: application/json
@body.json
EOF
Related on TokRepo
- Testing tools -- Load testing and quality assurance
- DevOps tools -- Infrastructure and performance tools
Common pitfalls
- Running Vegeta from a machine with limited bandwidth distorts results; test from a host near the target
- Very high rates (10K+/s) may exhaust local ports; increase
ulimit -nand use connection keep-alive - Vegeta measures client-side latency including network time; compare results from the same network location
Frequently Asked Questions
wrk and ab maximize throughput by opening as many connections as possible. Vegeta maintains a precise constant rate. Use wrk to find the breaking point; use Vegeta to measure behavior at a specific load level.
Yes. Specify the HTTP method, headers, and body in the targets file. Use @filename to reference a body file. Vegeta supports all HTTP methods including POST, PUT, PATCH, and DELETE.
Not natively. Vegeta runs on a single machine. For distributed testing, run Vegeta on multiple machines and merge results. The binary format allows combining results from multiple sources.
Vegeta produces text reports (default), JSON reports, HDR histogram data, and HTML latency plots. The pipeline model lets you choose the output format by piping to 'vegeta report' with different flags.
Yes. Vegeta's CLI interface and exit codes make it suitable for CI/CD. Set a latency threshold and fail the pipeline if p99 exceeds it. The JSON output can be parsed by CI scripts for automated assertions.
Citations (3)
- Vegeta GitHub— Vegeta is a Go HTTP load testing tool
- HDR Histogram— HDR Histogram for accurate latency measurement
- Vegeta README— HTTP load testing methodology and constant-rate testing
Related on TokRepo
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.