software · Q1663
Locust
Python load-testing framework with programmable users, HTTP clients and distributed workers.
Overview
Locust is an MIT-licensed load-testing framework that expresses simulated users and their behavior in Python. It can run through a web interface or without one, and coordinate multiple worker processes for larger tests.[1]
Python user behavior
A test is a Python module containing user classes and tasks. Each simulated user executes its task code sequentially inside a gevent greenlet, while many users run concurrently. Ordinary Python functions and packages can supply application-specific logic, data preparation and reusable helpers. This favors teams that want to review tests as code rather than maintain a separate graphical test-plan format.[2]
HTTP requests rather than browser sessions
The built-in HttpUser provides an HTTP client and preserves cookies, but it is not a browser. It does not interpret an HTML response to fetch every referenced asset or render the page. A workflow that depends on client-side JavaScript therefore needs a different testing approach or explicit request modeling. HTTP latency measurements should not be presented as evidence of visual page-load performance.[2]
Coordinating load generators
In distributed mode, a master supplies the web interface and instructs workers to start or stop users; the master does not generate those users itself. Workers send statistics back for aggregation. The convenient processes option relies on process forking and is unavailable on Windows, which is a limitation of that launcher rather than evidence that all Locust usage is unsupported there. CPU capacity remains a practical constraint on traffic generation.[3]
Other protocols and licensing
HTTP/HTTPS is Locust’s primary built-in workflow. Other protocols may use supplied integrations, including the documented experimental SocketIOUser and MqttUser, or a custom client that reports request events. Client I/O must cooperate with gevent: blocking I/O inside compiled libraries can stall an entire worker process unless a suitable workaround exists. Provided experimental integrations can change without notice. The framework’s MIT license permits reuse under its terms, but does not guarantee compatibility with every Python networking package.[1][4]
Substitution scope
Locust can substitute for Apache JMeter for scripted HTTP load generation where Python is the preferred authoring language. The tradeoff is moving from JMeter's plan editor and built-in sampler selection to Python tasks and, for non-HTTP systems, potentially custom instrumentation. Existing JMeter plans are not established as directly importable. A migration should preserve user pacing, request sequences and test-data isolation rather than merely matching a virtual-user count.[2][4][5]
Capabilities & limitations
Python load scenarios
supportedUser classes and tasks execute ordinary Python logic.[2]
Scripted HTTP and custom-protocol load testing · Windows, macOS, Linux · Version, plan and platform requirements apply
1 source · check evidence
Python tasks and HttpUser browser limitation
vendor · checked 2026-10-07Distributed workers
supportedMaster coordinates user-generating workers; the processes shortcut does not work on Windows.[3]
Scripted HTTP and custom-protocol load testing · Windows, macOS, Linux · Version, plan and platform requirements apply
1 source · check evidence
Master/worker roles and process-platform limits
vendor · checked 2026-10-07Other protocols
limitedMay use provided experimental integrations or custom instrumented clients; gevent-compatible I/O remains required.[4]
Scripted HTTP and custom-protocol load testing · Windows, macOS, Linux · Version, plan and platform requirements apply
1 source · check evidence
Request events and gevent compatibility
vendor · checked 2026-10-07Can substitute for
These are products or services this entry can replace. Check the task and limitations for each comparison.
Apache JMeter for Scripted HTTP and custom-protocol load testing
limitedReplaces HTTP load-generation workflows with Python tasks; non-HTTP samplers may need custom wrappers and plans are not directly interchangeable.[2][4][5]
Windows, macOS, Linux · Version, plan and platform requirements apply
References
- What is Locust?
Python, interfaces and MIT licensing
vendor · retrieved 2026-10-07 - Writing a Locust file
Python tasks and HttpUser browser limitation
vendor · retrieved 2026-10-07 - Locust distributed tests
Master/worker roles and process-platform limits
vendor · retrieved 2026-10-07 - Locust other protocols
Request events and gevent compatibility
vendor · retrieved 2026-10-07 - Apache JMeter overview
Features and browser limitations
vendor · retrieved 2026-10-07
Discussion & disputes
Ask about unclear claims or explain a concern with supporting sources. If you have a specific fix, suggest a correction.
No discussion yet.
Revision history
Open a revision to read an earlier version of this article.
| Revision | Timestamp | Edit summary |
|---|---|---|
| 1776 | 2026-10-25 22:13:37 | /* wbeditentity-create-item:0| */ sf:cfd5fdda-003c-41b1-be5a-55b42ff88ae0:v2 | Qualify non-HTTP testing to include documented experimental integrations as well as custom clients. Preserve gevent/compiled-I/O warnings, limited substitution | attribution: /proposals/cfd5fdda-003c-41b1-be5a-55b42ff88ae0 |