fortio load -qps -t -c: Load with QPS Control
fortio load -qps 500 -c 16 -t 30s http://localhost:8080/ drives 500 queries/sec across 16 connections for 30 seconds and prints a latency histogram.
Fortio (from the Istio project) is a load tester and server in one binary. Its load mode paces at a set -qps (or -qps 0 for max throughput) and can enforce a target percentile, which makes it a clean CI gate.
What it does
fortio load sends requests at -qps queries/sec using -c parallel connections for -t duration (or -n a fixed count). -qps 0 means run as fast as possible. It prints a latency histogram with percentiles; -p selects which percentiles to report and error/timeout counts.
Common usage
# 500 qps, 16 connections, 30s
fortio load -qps 500 -c 16 -t 30s http://localhost:8080/
# max throughput, fixed request count, JSON output
fortio load -qps 0 -c 32 -n 50000 -json result.json http://localhost:8080/Options
| Flag | What it does |
|---|---|
| -qps N | Target queries/sec (0 = max throughput) |
| -c N | Number of parallel connections |
| -t <dur> | Duration, e.g. 30s (or use -n) |
| -n N | Total number of requests |
| -p <list> | Percentiles to report, e.g. 50,90,99 |
| -json <file> | Write results as JSON |
| -H <header> | Add a request header |
In CI
Write -json result.json and parse DurationHistogram.Percentiles (or the top-level percentile fields) with jq to gate on p99, and check RetCodes so only 200s counted. Fortio load exits 0 on completion, so enforce the SLO yourself. Fortio can also run as a server (fortio server) to be the target under test.
Common errors in CI
fortio: command not found means install the binary (go install fortio.org/fortio@latest) or use the fortio/fortio image. dial tcp 127.0.0.1:8080: connect: connection refused means the target is not ready. A summary with RetCodes showing non-200 codes means the endpoint erred under load. If actual QPS is far below -qps, the server is the bottleneck, which is the signal to fail.