locust
AGENTS.md28k starsChanged 6 months agoMITView on GitHub
Locust is a developer-friendly, open-source load testing framework. This guide helps AI agents understand Locust's structure, conventions, and development practices. This file in itself was initially generated by Copilot. For full API and usage docs, see https://docs.locust.io/en/stable/llms-full.txt (or the lighter index at https://docs.locust.io/en/stable/llms.txt). Run checks locally: See docs/developing-locust.rst for detailed contribution instructions.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about locustio/locust
- PyCon Sweden“Load testing with Python and Locust by Lars Holmberg”YouTube · Jun 26, 2024 · 6.6k views
- HyScaler“How to Set Up Locust.io for Load Testing Your Web Application”YouTube · Jan 19, 2024 · 1.1k views
- Ram Vegiraju“Load Testing AI Agents with MLflow & Locust”YouTube · Jul 17, 2026 · 273 views
- Ram Vegiraju“Load Testing Databricks Model Serving Endpoints with Locust”YouTube · Jul 27, 2026 · 90 views
- Stack Overflow“Is it possible to add custom locust command line arguments”Stack Overflow · Jul 27, 2020 · 11 votes
The biggest 5 of 86 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 86
Talked about on GitHub, Stack Overflow, YouTube and Hacker News (86 times).
On GitHub · 50
- Jul 13, 2026deps(backend)(deps): update locust requirement from >=2.20.0 to >=2.45.0 — ahmdelbaz28-ux/BAZspark2 reactions · 6 comments
- Feb 3, 2026deps(py-dev): bump locust from 2.43.1 to 2.43.2 in the development-dependencies group — comppolicylab/pingpong2 reactions
- Jan 14, 2026deps(py-dev): bump locust from 2.43.0 to 2.43.1 in the development-dependencies group — comppolicylab/pingpong2 reactions
- Jan 12, 2026deps(py-dev): bump the development-dependencies group with 6 updates — comppolicylab/pingpong2 reactions
- Mar 26, 2026chore(deps): update dependency locust to v2.43.3 — GoogleCloudPlatform/psearch1 reaction
45 more on GitHub
- Feb 16, 2026deps(py-dev): bump locust from 2.43.2 to 2.43.3 in the development-dependencies group — comppolicylab/pingpong1 reaction · 1 comment
- Sep 9, 2025python3Packages.locust: fix locust and locust.webui builds — NixOS/nixpkgs1 reaction · 5 comments
- Mar 10, 2025Package request: locust — NixOS/nixpkgs1 reaction · 4 comments
- Mar 25, 2022Add generic load testing to end-to-end infra — microsoft/CCF1 reaction · 9 comments
- Feb 21, 2022[stable/locust] Pass --tags/--exclude-tags through the locust master — deliveryhero/helm-charts1 reaction · 1 comment
- Jun 4, 2020Using the exporter without the locust WebUI — ContainerSolutions/locust_exporter1 reaction · 1 comment
- May 16, 2019Hangs on locust import. — ipython/ipython1 reaction · 6 comments
- Nov 13, 2026Bump locust from 2.28.0 to 2.47.0 in /backend — Aswin-Shine/Nullify-Incident-Management-System0 reactions
- Nov 11, 2026build(deps-dev): bump locust from 2.46.7 to 2.47.0 in /backend — BenjaminGRUPO6/cafe-jaen0 reactions
- Nov 9, 2026chore(deps)(deps-dev): bump locust from 2.32.4 to 2.47.0 — mateusrfabro/poolcompras0 reactions · 1 comment
- Nov 9, 2026Update locust requirement from >=2.44.4 to >=2.47.0 in /backend — dallas8000-ops/Deployment-Stripe-center0 reactions
- Nov 6, 2026Bump locust from 2.46.7 to 2.47.0 — agrant16/ledger0 reactions
- Nov 5, 2026chore(deps): update locust requirement from <3.0,>=2.32 to >=2.47.0,<3.0 — GuilhermeFreire7/squadup-back0 reactions · 1 comment
- Nov 4, 2026Bump locust from 2.32.4 to 2.47.0 — cherrydasika/ingenmind0 reactions
- Nov 4, 2026chore(deps): bump locust from 2.46.1 to 2.47.0 — kush-coder/autopilot-omnigent-v20 reactions · 1 comment
- Nov 4, 2026chore(deps): update locust requirement from >=2.46.6 to >=2.47.0 in /backend — dallas8000-ops/AI-Software-Operations-Studio0 reactions
- Nov 1, 2026chore(deps): bump locust from 2.46.1 to 2.47.0 — omnigent-ai/omnigent0 reactions · 2 comments
- Nov 1, 2026chore(deps-dev): bump locust from 2.46.7 to 2.47.0 in /offline — shing26/OpsShield0 reactions
- Oct 31, 2026chore(deps-dev): update locust requirement from >=2.46.7 to >=2.47.0 — Schengii/AI-Softwareentwickler-Team0 reactions
- Oct 31, 2026Update locust requirement from >=2.29 to >=2.47.0 — enterthevoid8/claimlens-usa0 reactions
- Oct 29, 2026chore(deps): bump the pip group across 1 directory with 3 updates — T-Py-T/aks-ado-microservices-cicd0 reactions
- Oct 28, 2026Bump locust from 2.37.5 to 2.47.0 — Flickpond/Media_player0 reactions
- Oct 28, 2026build(deps-dev): bump locust from 2.46.7 to 2.47.0 — kogunlowo123/runtime-authorization-platform0 reactions
- Oct 28, 2026build(deps-dev): bump locust from 2.46.7 to 2.47.0 — kogunlowo123/lab-quality-control-agents0 reactions
- Oct 28, 2026build(deps-dev): bump locust from 2.46.7 to 2.47.0 — kogunlowo123/clinical-workflow-orchestration0 reactions
- Oct 28, 2026build(deps-dev): Bump locust from 2.46.7 to 2.47.0 — kogunlowo123/gxp-agent-runtime0 reactions
- Oct 27, 2026Build(deps): Bump locust from 2.46.7 to 2.47.0 — roy032/qualitylens0 reactions
- Oct 26, 2026Bump locust from 2.46.4 to 2.47.0 in /loadgenerator — taloric/flask-sw-demo0 reactions
- Oct 26, 2026chore(deps): bump locust from 2.46.1 to 2.47.0 — omnigent-ai/omnigent0 reactions · 2 comments
- Oct 26, 2026deps(backend)(deps): update locust requirement from >=2.46.3 to >=2.47.0 — ahmdelbaz28-ux/BAZspark0 reactions · 3 comments
- Oct 25, 2026Bump locust from 2.43.3 to 2.47.0 in /backend — jayaseelan2006/website0 reactions
- Oct 24, 2026fix: bump locust from 2.46.0 to 2.47.0 — groupthinking/EventRelay0 reactions · 3 comments
- Oct 24, 2026Bump locust from 2.32.5 to 2.46.7 — Som0111/contrail0 reactions
- Oct 22, 2026Locust through 2.46.7 CSRF via Web UI /stop and /stats/reset — NixOS/nixpkgs0 reactions
- Oct 14, 2026Update locust requirement from <3,>=2.46 to >=2.46.7,<3 in /loadtest — PococodoOrg/PocoClinic0 reactions
- Oct 13, 2026chore(deps): update locust requirement from >=2.46.6 to >=2.46.7 in /web/api — ShAuRyA-Noodle/aura-on-device0 reactions
- Oct 12, 2026build(deps-dev): bump locust from 2.31.8 to 2.46.7 — adishri2005/meghdrishti0 reactions · 1 comment
- Oct 12, 2026deps: Bump locust from 2.46.6 to 2.46.7 — rubensalonso/QA-Framework_Claude0 reactions · 1 comment
- Oct 12, 2026Update locust requirement from >=2.20 to >=2.46.0 — shamimkhaled/archive0 reactions
- Oct 11, 2026build(deps): Update locust requirement from >=2.24.0 to >=2.46.7 in /prequal-platform — siumsamuel2-bot/prequal-platform0 reactions · 1 comment
- Oct 5, 2026chore(deps): update locust requirement from >=2.24.0 to >=2.46.6 — maxmae2211-cell/repo-gotowe0 reactions · 2 comments
- Oct 5, 2026Update locust requirement from >=2.29.0 to >=2.46.6 — YGTYLRM/kmu-comply0 reactions
- Sep 23, 2026chore(deps): update locust requirement from >=2.31 to >=2.46.6 in /backend — ayimmam/wellcircle-hackathon0 reactions · 1 comment
- Sep 6, 2026Bump locust from 2.46.3 to 2.46.4 — gsz0827/kiwi-tcms-ai-platform0 reactions
- Aug 8, 2026[Test] [RayService] Locust exits non-zero on shutdown due to gevent/SIGINT race, causing flaky test failures — kuberay-project/kuberay0 reactions · 6 comments
On Stack Overflow · 30
- Jul 27, 2020Is it possible to add custom locust command line arguments11 votes
- Nov 12, 2013Performance testing: JMeter vs Tsungsays it tested it7 votes
- Jul 13, 2020Locust load testing - change hatch rate from seconds to minutes?5 votes
- Nov 8, 2021How to call async method from greenlet (playwright)4 votes · 2 answers
- Apr 20, 2021Can't generate more than ~8000 RPM from Locust3 votes
25 more on Stack Overflow
- Dec 11, 2020How to configure or set cookie as json before making a post request in locust load test tool for FastHTTPUser3 votes
- Nov 8, 2017How to invoke Locust tests programmatically?3 votes
- May 10, 2024Unable to stop Locust as Greenlet/Gevent error found causing state to stuck at CleanUp2 votes
- May 9, 2023How to count throttled requests on a per endpoint in Locust?2 votes
- Nov 23, 2021How can I send report on stop locust (as lib mode)2 votes
- Jan 13, 2021How to configure Locust to use https?2 votes
- Aug 14, 2020Locust RPS value not coming correct #LOCUST # rpsissue2 votes
- Sep 11, 2025How can I perform Load testing with Locust using PyTest?1 vote
- Sep 12, 2024How to retrieve statistics from master node as tests are running1 vote
- Sep 6, 2023Customize percentages displayed in report.html by locust1 vote
- Aug 31, 2023Locust: event for master when a new worker joins1 vote
- Jun 22, 2023Tracking shared custom metrics from api responses with locust1 vote
- Jan 29, 2023Prefer binary package in setup.cfg1 vote
- Jul 28, 2022Worker unable to connect to the master and invalid args in webport for Locust1 vote
- Apr 23, 2022Locust load test a "not secure" site1 vote
- Oct 8, 2021Locust eats CPU after 2-3 hours running1 vote
- Jul 21, 2021Locust - take response time out of RPS equation?1 vote
- May 24, 2021How to interprete the Locust results1 vote
- Oct 30, 2020How to increase RPS in distributed locust load test1 vote
- May 8, 2020A different way to define hatch rate of client in locust at the start?1 vote
- Apr 20, 2020How to auto scale Locust in Kubernetes1 vote · 1 answer
- Sep 13, 2019Locust not supporting `--exit-code-on-error` argument?1 vote · 1 answer
- May 24, 2017Python - logging requests summary stats using locust1 vote
- Oct 17, 2016Where can I find locust logs?1 vote
- Nov 6, 2022OSError: [Errno 97] when trying to run locust in Linux RHEL0 votes
On YouTube · 4
- Jun 26, 2024Load testing with Python and Locust by Lars Holmberg — PyCon Swedensays it tested it6.6k views · 2 comments
- Jan 19, 2024How to Set Up Locust.io for Load Testing Your Web Application — HyScalersays it tested it1.1k views · 1 comment
- Jul 17, 2026Load Testing AI Agents with MLflow & Locust — Ram Vegirajusays it tested it273 views
- Jul 27, 2026Load Testing Databricks Model Serving Endpoints with Locust — Ram Vegirajusays it tested it90 views
On Hacker News · 2
- Aug 4, 2021Locust: Scalable user load testing tool written in Python4 points
- Feb 25, 2022What Is Locust?1 point
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 74
Contributing docs: Add documentation for new features if they are user-facing
- Very specific: line 75
Examples: Add example scripts in examples/
- Very specific: line 89
Events: Use event.request, event.test_start, event.test_stop, etc.
- Distinctive: line 93
Pytest: All tests use pytest (not unittest)
- Distinctive: line 95
Mocking: Use pytest fixtures; mock external services
- Very specific: line 99
Monkey patching: Always import from locust import ...
- Distinctive: line 101
Async patterns: Use gevent for concurrency, not asyncio
- Very specific: line 123
Create a module in locust/contrib/<protocol>/
- Very specific: line 125
Add tests in locust/test/test_<protocol>.py
- Very specific: line 127
Add example in examples/<protocol>/
- Very specific: line 132
Update documentation in docs/
- Very specific: line 133
Run full test suite: uv run pytest locust/test
- Very specific: line 136
Run with -v (verbose) or --loglevel=DEBUG for debug output
- Distinctive: line 143
Use modern Python syntax; avoid deprecated patterns
- Very specific: line 147
If installed, pre-commit automatically runs ruff and mypy checks before commits
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Locust Project Guidelines for AI Agents
Locust is a developer-friendly, open-source load testing framework. This guide helps AI agents understand Locust's structure, conventions, and development practices. This file in itself was initially generated by Copilot.
For full API and usage docs, see https://docs.locust.io/en/stable/llms-full.txt (or the lighter index at https://docs.locust.io/en/stable/llms.txt).
Code Style & Formatting
- Language: Python 3.11+
- Line length: 120 characters (enforced by ruff)
- Linter: ruff (handles linting, import sorting, and upgrades)
- Type checking: mypy with
ignore_missing_imports = true - Import order: Locust imports come first (for gevent monkey patching), then stdlib, third-party, and local imports
- Ignored rules: E402, E501, E713, E731, E741, UP031, PERF203 (see
pyproject.tomlfor details)
Run checks locally:
uv run ruff check locust/
uv run mypy locust/Architecture
Core Components
locust/: Main packageuser/: User classes (HttpUser, User)runners.py: Test execution and distributed coordinationstats.py: Request/response statisticsweb.py,webui/: Web UI (Flask-based)clients.py: HTTP client implementationsrpc/: Remote procedure calls for distributed testingcontrib/: Optional protocol/database clients
locust/test/: Unit and integration tests (pytest)examples/: Example locustfiles demonstrating various patternsdocs/: Sphinx documentation (.rstformat)
Key Patterns
- Event-driven: Uses gevent for concurrency; events for messaging (
event.py) - Pluggable: Can test multiple protocols (HTTP, gRPC, MQTT, MQTT, etc.)
Build and Test
Setup Development Environment
# Install uv (build system)
# Clone and enter the repo
uv sync # Install dependencies with hatch groupsRunning Tests
uv run pytest locust/test # Run all tests
uv run pytest locust/test/test_main.py # Run specific test file
hatch test # Test across multiple Python versionsRunning Linting and Type Checks
uv run pre-commit run --all-files # Auto-fix formatting issues
uv run ruff check locust/ # Check linting rules
uv run mypy locust/ # Type checkingBuilding and Installing Locally
uv run locust # Run your modified codeDocumentation
- Format: reStructuredText (
.rst) indocs/ - Generate locally:
make build_docs - Contributing docs: Add documentation for new features if they are user-facing
- Examples: Add example scripts in
examples/
See docs/developing-locust.rst for detailed contribution instructions.
Conventions
File Organization
- Community contributed User classes: Go in
locust/contrib/(e.g.,grpc/,mqtt/) - Core User classes:
HttpUserandFastHttpUser - Tests: Mirror source structure in
locust/test/
Naming and Patterns
- User classes: Inherit from
UserorHttpUser; define@taskmethods for test scenarios - Statistics: Custom stats reporters hook into
stats_*events - Events: Use
event.request,event.test_start,event.test_stop, etc. - Load shapes: Implement
LoadShapefor custom load profiles
Testing Conventions
- Pytest: All tests use pytest (not unittest)
- Test discovery: Files named
test_*.pyor*_test.py - Mocking: Use pytest fixtures; mock external services
- Example files: May be excluded from strict linting (see
pyproject.toml)
Gevent and Concurrency
- Monkey patching: Always import
from locust import ...before other imports - Greenlets: Users run in separate greenlets; use normal blocking code
- Async patterns: Use gevent for concurrency, not asyncio
Key Dependencies
- gevent: Green threads for concurrency
- Flask: Web UI backend
- requests: HTTP client (with geventhttpclient option)
- msgpack: Message serialization for distributed testing
- pyzmq: Distributed communication
- pytest: Test framework
- ruff: Code quality and formatting
Distributed Testing
- Master-worker architecture:
locust/runners.py,locust/rpc/ - Coordination: Uses ZMQ for inter-process communication
- Event propagation: Custom events sync across distributed nodes
- Refer to
docs/running-distributed.rstfor patterns
Common Tasks
Adding a New Protocol Client
- Create a module in
locust/contrib/<protocol>/ - Implement a user class inheriting from
User - Add tests in
locust/test/test_<protocol>.py - Document in
docs/testing-other-systems.rst - Add example in
examples/<protocol>/
Adding a Feature to Core
- Modify relevant file (e.g.,
locust/runners.pyfor test execution) - Add comprehensive tests
- Update documentation in
docs/ - Run full test suite:
uv run pytest locust/test
Debugging
- Run with
-v(verbose) or--loglevel=DEBUGfor debug output - See
docs/running-in-debugger.rstfor IDE debugging
Python Version Support
- Minimum: Python 3.11
- Tested versions: 3.11, 3.12, 3.13, 3.14, 3.15 (via hatch environments)
- Use modern Python syntax; avoid deprecated patterns
Pre-commit and CI/CD
- If installed,
pre-commitautomatically runs ruff and mypy checks before commits - See
.pre-commit-config.yamlfor hook configuration - GitHub Actions runs full test suite on PRs
Links
- Official Documentation
- GitHub Repository
- Contributing Guide
- Writing Locustfiles
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

