Locust load testing: a review of the Python tool
6 min read updated
Locust is a free, MIT-licensed Python load testing tool in which every test is a Python program, run by lightweight users from a web UI or the command line. Locust load testing suits teams that write Python and mostly test HTTP services. Teams that need many protocols out of the box or a GUI test builder are better served by JMeter, and teams that write JavaScript by k6.
We have not run Locust for this review. The facts come from Locust’s own documentation, repository and PyPI page, checked on 9 October 2026, and the judgements are ours.
| Topic | Locust |
|---|---|
| Licence | MIT |
| Runtime | Python 3.11 or later |
| Current release | 2.46.7 (4 October 2026) |
| Tests written as | Python classes in a locustfile |
| Ways to run | Web UI on port 8089, or headless |
| Built-in protocols | HTTP and HTTPS |
| Scaling out | One master and any number of workers |
| Results | Live charts, CSV, HTML, JSON, OpenTelemetry |
| CI | Exit code 1 when any request failed |
Who makes Locust, and is it still maintained?
Lars Holmberg maintains Locust, and Microsoft sponsors the work. Releases are frequent: 17 so far in 2026.
The Locust README names both. PyPI lists 2.46.7, published on 4 October 2026, as the latest release, with Python 3.11 or later required (checked on 9 October 2026).
How does a locustfile work?
A locustfile is an ordinary Python module with at least one user class. Each simulated user runs its tasks one after another and pauses for its wait_time in between.
Per the locustfile guide, HttpUser gives each user a client that wraps python-requests, keeps cookies and records every request. Methods marked @task are picked at random, weighted by the number in the decorator, and on_start runs once per user. This user logs in, browses four times as often as it checks out, and starts a task at most once every 10 seconds:
from locust import HttpUser, task, constant_pacing
class Shopper(HttpUser):
wait_time = constant_pacing(10)
def on_start(self):
self.client.post("/login", json={"user": "demo"})
@task(4)
def browse(self):
self.client.get("/products?page=2", name="/products")
@task
def checkout(self):
with self.client.post(
"/checkout", catch_response=True
) as resp:
if "order_id" not in resp.text:
resp.failure("no order id")
catch_response lets you fail a request on its content, and name groups changing URLs into one row. The other wait functions are constant, between, constant_throughput and, since release 2.46.6, poisson; our guide to think time in load testing explains how pauses shape the load. The docs add that wait time can only limit throughput and cannot start users to reach a target rate, so a Locust test is a fixed pool of users: a closed workload model.
Should you use the web UI or run headless?
Use the web UI while you explore and headless mode for repeatable runs.
Running locust starts a web interface on port 8089, where you set the host, users and ramp-up, watch live charts and change the load mid-test. Headless mode takes the same settings as flags:
locust -f locustfile.py --headless -u 200 -r 10 -t 10m \
--host https://staging.example.com \
--csv results --html report.html
-u sets the users, -r how many start per second and -t the run time, ramp-up included. The same settings also work in locust.conf or pyproject.toml.
How does distributed mode work?
A master process runs the web UI and coordinates, while worker processes run the users and report back. You need one worker per CPU core, because a Python process cannot fully use more than one.
The distributed load docs put one process at over a thousand requests per second for a simple test plan, so bigger tests scale out:
# on the master machine
locust -f locustfile.py --master
# on each worker machine, one worker per core
locust -f - --worker --master-host 10.0.0.5 --processes -1
-f - fetches the locustfile from the master. --processes relies on fork(), so it does not work on Windows, and every process needs a restart after the locustfile changes. The docs also cover a Kubernetes operator and Azure Load Testing (checked on 9 October 2026).
LoadFocus, which publishes this site, does not run Locust tests. It runs JMeter test plans and k6 scripts from 25 cloud regions, so for Locust the routes above are the ways to scale.
Can Locust test protocols other than HTTP?
Yes, if you bring a Python client for the protocol. HTTP and HTTPS are the only protocols built in.
The page on other protocols shows how to wrap a client so each call is recorded, with examples for XML-RPC and gRPC and experimental users for MQTT, Socket.IO and OpenAI. The separate locust-plugins project adds Kafka, FTP, Selenium and Playwright users (checked on 9 October 2026).
For HTTP there is also FastHttpUser, which uses geventhttpclient and much less CPU: the docs’ best case for one process is about 16,000 requests per second, against 4,000 with HttpUser. FastHttpUser does not make single requests faster, and it skips TLS certificate checks by default.
What reports does Locust give you, and how does it fit into CI?
You get live charts in the web UI and result files on request. In CI, Locust exits with code 1 if any request failed.
Per the configuration reference, --csv writes statistics, history and failures files, --html saves a report and --json prints the final statistics. --otel exports to an OpenTelemetry backend. The headless docs show a listener that fails the run on failure ratio, average response time or 95th percentile, and our guide to load testing in GitHub Actions puts it in a workflow.
What does Locust do well, and where are its limits?
It is strong on test logic and on many concurrent, mostly idle users. It is weaker on request rate per process and on protocols you wire up yourself.
Plain Python means loops, branches, generated data and your own API client all work, and tests sit in version control. The What is Locust page says the low cost of each user suits highly concurrent workloads, while granting that other tools may send more requests per second on the same hardware.
Limits the docs state themselves:
- One Python process uses one CPU core.
- Libraries doing I/O in C block the process unless gevent can patch them.
HttpUserdoes not parse HTML or load page resources.- Wait time cannot add users to hold a request rate.
Which other Python load testing tools are there?
Locust is the actively developed Python engine. Molotov, the main alternative, has had no release on PyPI since 2022, and Taurus runs Locust through one of its executors.
Molotov is a Python 3.8+ tool built on asyncio and aiohttp; its latest release on PyPI is 2.6, from 21 October 2022, and the last commit on its main branch dates from November 2023 (checked on 21 October 2026). Taurus runs a locustfile, or GET and POST requests written in YAML, through its locust executor. You install Locust yourself, Taurus starts only the master in distributed mode, and its throughput setting has no effect with this executor (checked on 21 October 2026).
When should you choose k6, JMeter or Gatling instead?
Choose another tool when its language, protocols or load model fit your team better.
Our overview of open source load testing tools sets Locust next to five others.
Choose k6 instead when your team writes JavaScript, wants pass/fail thresholds in the script, or needs an open workload model, which k6’s arrival-rate executors provide (checked on 9 October 2026). LoadFocus runs k6 scripts from 25 cloud regions, though it runs arrival-rate scenarios with a fixed number of users, so for a held request rate run them with k6 itself.
Choose JMeter instead when you need JDBC, JMS, LDAP or FTP out of the box, as its README lists, or when your testers build tests in a GUI. Locust vs JMeter compares the two in detail.
Choose Gatling instead when your team works on the JVM and wants open and closed injection profiles in one API (checked on 9 October 2026). Gatling vs JMeter covers it further.
FAQ
Is Locust free for commercial use? Yes. Locust is released under the MIT licence, which permits commercial use, modification and redistribution.
Which Python version does Locust need?
Python 3.11 or later, according to its PyPI metadata. Install it with pip install locust, or run it in a temporary environment with uvx locust.
Can LoadFocus run Locust tests? No. LoadFocus runs JMeter test plans and k6 scripts. To scale a Locust test, use its master and worker mode, the Kubernetes operator or Azure Load Testing.
Related reading
- Locust vs JMeter: Python scripts or JMeter test plans?
- Open source load testing tools: six options reviewed
- k6 vs Locust: JavaScript scripts or Python users?
- Gatling vs Locust: JVM simulations or Python locustfiles?
The technical claims in this article have not been independently reviewed.