Locust RPS stuck at 0 / all requests failing in CI
When Locust shows 0 RPS or a 100% failure column, no request is completing successfully. In CI this almost always means the --host is wrong or unreachable, the target is not up, or requests are rejected for missing auth.
What this error means
The Locust stats table shows all requests under the "# fails" column, RPS near 0, and a failures list dominated by ConnectionError or a repeated 401/403/404.
Type Name # reqs # fails | Avg ... # RPS
GET / 0 412(100%) | 0 ... 0.00
ConnectionError(... Connection refused ...) 412Common causes
Wrong or unreachable host
A --host that points at the wrong address, or a target not yet listening, makes every request raise a connection error.
Missing auth or wrong path
If the endpoint needs a token or the path is wrong, every request returns 401/403/404 and counts as a failure.
How to fix it
Confirm host reachability before the run
- Curl the target from the same job to prove it is up and correct.
- Pass the confirmed URL as
--host. - Wait for readiness so the run does not start against a down target.
curl -sf http://localhost:8080/health
locust --headless -u 100 -r 10 --run-time 1m --host http://localhost:8080Send required auth in the task
Attach the token or session the endpoint requires so requests succeed instead of returning 401/403.
from locust import HttpUser, task
class ApiUser(HttpUser):
@task
def get(self):
self.client.get("/", headers={"Authorization": "Bearer " + TOKEN})How to prevent it
- Verify the target is up and the host is correct before load.
- Provide auth headers or a login flow in the locustfile.
- Use correct request paths so responses are not all failures.