# Locust

Python load\-testing framework with programmable users, HTTP clients and distributed workers\.

ID: Q1663 · Revision: 1776

Type: software · License: MIT[^locust-home] · Status: active

Website: https://locust.io/



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\.[^locust-home]

## 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\.[^locust-code]

## 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\.[^locust-code]

## 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\.[^locust-dist]

## 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\.[^locust-other][^locust-home]

## Substitution scope

Locust can substitute for [Apache JMeter](/apachejmeter) 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\.[^locust-code][^locust-other][^jmeter-home]

## Capabilities and substitutions

### Python load scenarios — supported

User classes and tasks execute ordinary Python logic\.[^locust-code]

Use case: Scripted HTTP and custom\-protocol load testing · Platforms: Windows, macOS, Linux · Region: Version, plan and platform requirements apply

### Distributed workers — supported

Master coordinates user\-generating workers; the processes shortcut does not work on Windows\.[^locust-dist]

Use case: Scripted HTTP and custom\-protocol load testing · Platforms: Windows, macOS, Linux · Region: Version, plan and platform requirements apply

### Other protocols — limited

May use provided experimental integrations or custom instrumented clients; gevent\-compatible I/O remains required\.[^locust-other]

Use case: Scripted HTTP and custom\-protocol load testing · Platforms: Windows, macOS, Linux · Region: Version, plan and platform requirements apply

### [Substitute for Apache JMeter](/apachejmeter) — limited

Replaces HTTP load\-generation workflows with Python tasks; non\-HTTP samplers may need custom wrappers and plans are not directly interchangeable\.[^locust-code][^locust-other][^jmeter-home]

Use case: Scripted HTTP and custom\-protocol load testing · Platforms: Windows, macOS, Linux · Region: Version, plan and platform requirements apply

## References

[^locust-home]: [What is Locust?](<https://docs.locust.io/en/stable/what-is-locust.html>) — Python, interfaces and MIT licensing (vendor; retrieved 2026-10-07T11:00:02Z)

[^locust-code]: [Writing a Locust file](<https://docs.locust.io/en/stable/writing-a-locustfile.html>) — Python tasks and HttpUser browser limitation (vendor; retrieved 2026-10-07T11:03:29Z)

[^locust-dist]: [Locust distributed tests](<https://docs.locust.io/en/stable/running-distributed.html>) — Master/worker roles and process\-platform limits (vendor; retrieved 2026-10-07T11:04:35.494Z)

[^locust-other]: [Locust other protocols](<https://docs.locust.io/en/stable/testing-other-systems.html>) — Request events and gevent compatibility (vendor; retrieved 2026-10-07T11:04:37.138Z)

[^jmeter-home]: [Apache JMeter overview](<https://jmeter.apache.org/>) — Features and browser limitations (vendor; retrieved 2026-10-07T11:00:02Z)

Source revision: https://substitutefor.net/entities/Q1663?revision=1776
