talira

HTTP load testing tool and library built to drill HTTP services with a constant request rate

open sourceMITself-hostablefree

Vegeta is an HTTP load testing command-line tool and Go library that sends requests at a constant rate rather than with a fixed number of users, which avoids the coordinated omission problem that hides latency in many load generators. Its commands follow UNIX composition: vegeta attack reads targets from stdin or a file (in a simple HTTP format or JSON, with headers and bodies) and writes binary results that vegeta report turns into text, JSON or latency histograms, vegeta plot into an interactive HTML latency chart, and vegeta encode into JSON or CSV. It supports HTTP/2, h2c, TLS client certificates and lazily generated targets, can expose a Prometheus exporter during an attack, and distributed tests run by starting attacks on several machines and merging their result files. It ships as a single static binary for Linux, macOS, Windows, FreeBSD and OpenBSD, and is MIT licensed.

Ways to install

Package managers

Problems it solves

  • hit an HTTP endpoint at exactly 1,000 requests per second for five minutes and see the latency percentiles
  • my load test tool hides slow responses because it waits for each one before sending the next
  • load test an API from the command line and pipe the results into other tools
  • plot request latency over time from a load test as an HTML chart
  • generate a latency histogram with my own buckets from a load test
  • feed generated targets with changing request bodies into a load test from a script
  • load test a service over HTTP/2 or with TLS client certificates
  • add constant-rate HTTP load generation to a Go program as a library
  • export load test results to CSV or JSON for analysis
  • watch a load test's request rate and latency in Prometheus and Grafana while it runs
  • find the request rate where our service starts returning errors
  • a single static binary for HTTP benchmarking I can drop on any server

Features

  • constant request rate that avoids coordinated omission
  • usable as a CLI and a Go library
  • attack, report, plot and encode commands that compose with pipes
  • targets in HTTP or JSON format, read from stdin, a file or lazily from a generator
  • text, JSON, histogram and HDR plot reports
  • interactive HTML latency plot
  • JSON, CSV and gob result encodings
  • HTTP/2, h2c, TLS client certificates and custom root CAs
  • Prometheus exporter during attacks, with a sample Grafana dashboard
  • report merges result files from several machines
View 1 more
  • static binaries for Linux, macOS, Windows, FreeBSD and OpenBSD

Limitations

  • No built-in coordinator for distributed tests: you run an attack on each machine yourself (for example with pdsh) and merge the result files2

Capabilities

Has a command line toolplan not known
Has official SDKsplan not known

Alternatives

The same job

These do what Vegeta does.

  1. Locust An open source load testing tool: define user behaviour in plain Python and swarm your system with millions of simultaneous users
  2. Apache JMeter A 100% pure Java application designed to load test functional behavior and measure performance
  3. Artillery Full-stack performance and reliability testing: scalable API and Playwright load testing
  4. Grafana k6 Like unit testing, for performance
  5. Gatling Modern load testing as code
  6. oha HTTP load generator with a realtime terminal UI, inspired by hey

Compare Vegeta with the top 3