locust
Developer-friendly load testing framework
What it is and what it does
Locust is a developer-friendly load testing framework that lets you write performance tests in regular Python code rather than XML or domain-specific languages. Tests define user behavior using Python classes and decorators, with each simulated user running in its own lightweight greenlet (via gevent), enabling natural blocking-style code. The framework supports distributed testing across multiple machines to simulate concurrent users, and provides both a web-based UI for real-time monitoring and command-line execution for CI/CD integration.
You write test scenarios as Python code, import libraries freely, and leverage Locust's pluggable architecture to extend or adapt behavior. The framework can test HTTP services by default and is extensible to other protocols. Results—throughput, response times, errors—are viewable in real time and exportable for analysis. Its small, intentionally minimal codebase makes it easy to customize for specific use cases without being locked into a GUI or predefined patterns.
Use it for:
- Simulate concurrent HTTP traffic to measure web service response times and throughput under load before production deployment.
- Run distributed load tests across multiple machines to stress-test APIs with concurrent users.
- Automate performance regression testing in CI/CD pipelines by running headless Locust tests and exporting results.
- Test non-HTTP protocols or custom systems by writing a client in Python and plugging it into Locust's user model.
- Monitor real-time test progress via the web UI and adjust load parameters mid-test without stopping the scenario.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Locust is a Python-based load testing framework that lets you write performance tests in regular Python code and run them against HTTP and other protocols, with real-time monitoring via a web UI or command line.
Yes. Locust is actively maintained, has no known vulnerabilities, installs with low friction, and is well-suited for teams that prefer writing tests in Python over GUI-based tools. The permissive MIT license removes legal friction. Install it if you need load testing with code-based test definition, distributed scaling, and real-time monitoring—especially for HTTP services or when you want to avoid proprietary testing platforms.
Install
locust on PyPI
pip
pip install locustuv
uv add locustpoetry
poetry add locustInstalling locust
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release (13 days ago) and strong community engagement (28071 GitHub stars). Supports current Python versions (3.11–3.15).
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions—you may use, modify, and distribute Locust freely as long as you include the license notice.
Quickstart
pip install locust
from locust import HttpUser, task, between
class TestUser(HttpUser):
wait_time = between(1, 2)
@task
def test_endpoint(self):
self.client.get("/api/endpoint")
Requires Python 3.11 or later.
Verify before relying
- Whether gevent-based concurrency model meets specific throughput or latency requirements for your workload.
- Performance characteristics when scaling to hundreds of thousands of users.
- Compatibility with custom protocol clients beyond HTTP.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 16 — configargparse, flask-cors, flask-login, flask, gevent, geventhttpclient, msgpack, psutil, pytest, python-engineio, python-socketio, pywin32, pyzmq, requests, typing-extensions, werkzeug |
| Maintenance | actively maintained — 13 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 14,055,255/month — #1,250 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: locust-2.46.3-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
locust-cloudLocust Cloud is a client library for running…
permissive · top 5,000 on PyPI
locust-pluginsExtends Locust with plugins for load testing…
permissive · top 5,000 on PyPI
bztTaurus is a command-line wrapper that…
permissive · top 5,000 on PyPI
rfswarm-agentrfswarm-agent lets you run Robot Framework test…
copyleft · top 15,000 on PyPI
apache-airflow-microsoft-fabric-pluginEnables Apache Airflow DAGs to trigger…
unclear · top 5,000 on PyPI
azure-batchProvides a Python client library to submit,…
unclear · top 1,000 on PyPI
azure-storage-queueClient library for interacting with Azure Queue…
permissive · top 1,000 on PyPI
azure-cli-coreProvides the core Python library and CLI…
permissive · top 5,000 on PyPI
greenletGreenlet provides lightweight coroutines for…
permissive · top 100 on PyPI
agent-framework-ollamaIntegrates Ollama LLM provider support into…
permissive · top 15,000 on PyPI