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]
Contents 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]
Also included: 3 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.