siege: -c Concurrency, -t Duration, URLs File
siege -c N -t 1M simulates N concurrent users hitting a URL (or a list from -f urls.txt) for one minute and reports availability, throughput, and response time.
siege reads like a user simulator: -c users, -t time, and an optional urls file it rotates through. Its Availability and Longest transaction metrics are the ones to gate on in CI.
What it does
siege spawns -c concurrent virtual users that repeatedly request either a single URL or lines from a -f file for the -t duration. It reports Transactions, Availability (percent of non-failing requests), Response time, Transaction rate, and Longest/Shortest transaction. -b/--benchmark removes the human-like delay between requests.
Common usage
# 50 users, 1 minute, no think time, internet mode
siege -c 50 -t 1M -b http://localhost:8080/
# cycle a list of URLs
siege -c 25 -t 30S -b -f urls.txtOptions
| Flag | What it does |
|---|---|
| -c, --concurrent N | Number of concurrent users |
| -t, --time T | Run for a duration, e.g. 1M, 30S, 1H |
| -r, --reps N | Run N repetitions instead of a duration |
| -b, --benchmark | No delay between requests (throughput mode) |
| -f, --file <urls> | Read URLs to hit from a file |
| -i, --internet | Hit the URLs file in random order |
| -j, --json-output | Emit results as JSON |
In CI
Run with -j and read Availability and elapsed transaction rate from the JSON, then fail if availability is below 100% or the longest transaction breaches budget. Note the duration units are letters: 30S seconds, 1M minutes, 1H hours (a bare number is seconds).
Common errors in CI
siege: command not found needs apt-get install -y siege or apk add siege. [error] unable to parse URL means a malformed line in the urls file (each needs a scheme). [alert] socket: unable to connect ... Connection refused means the target is not up. If it errors reading config, set SIEGERC=/dev/null or run siege.config once, since siege wants a ~/.siege/siege.conf that may not exist on a fresh runner.