Locust
FrameworkFreePython load testing framework for APIs and AI endpoints.
Capabilities12 decomposed
python-based user behavior definition with decorator-driven task composition
Medium confidenceEnables defining load test scenarios as Python classes (User, HttpUser) where test logic is expressed through @task decorators and methods rather than GUI or XML configuration. The framework uses Python's full expressiveness for conditional logic, loops, and state management within user behavior definitions. Each User class instance runs in its own gevent greenlet, allowing thousands of concurrent users to be simulated with minimal memory overhead through event-based concurrency rather than OS threads.
Uses Python classes with @task decorators and gevent greenlets for lightweight concurrency, allowing developers to write test logic in standard Python rather than proprietary languages or XML, with full IDE autocomplete and debugging support
More expressive than JMeter's GUI or LoadRunner's scripting because it leverages Python's full language features and ecosystem, while being more lightweight than thread-based approaches due to gevent's event-driven model
distributed load testing with master-worker zmq architecture
Medium confidenceImplements a master-worker pattern using ZMQ (ZeroMQ) for inter-process communication that distributes user load across multiple machines. The MasterRunner coordinates test execution, receives statistics from WorkerRunner instances, and aggregates metrics in real-time. The UsersDispatcher component uses a KL-divergence algorithm to calculate optimal user distribution across workers, ensuring balanced load distribution even with heterogeneous worker capacities. Workers connect to the master via ZMQ sockets and report per-request statistics that are aggregated into global RequestStats.
Uses ZMQ for stateless worker communication with KL-divergence-based user distribution algorithm, enabling dynamic load rebalancing across workers without requiring shared state or consensus protocols
More scalable than single-machine load testing and simpler to deploy than Kubernetes-native tools like k6 Cloud because it uses standard ZMQ without requiring cloud infrastructure, though less integrated than managed SaaS solutions
gevent-based greenlet concurrency with lightweight user simulation
Medium confidenceUses gevent's greenlet model to simulate thousands of concurrent users in a single process with minimal memory overhead. Each simulated user runs in its own greenlet (lightweight pseudo-thread), allowing context switching without OS thread creation. The framework patches standard library I/O operations (socket, select, etc.) to be non-blocking, enabling greenlets to yield control when waiting for I/O. This approach achieves 10-100x better concurrency than thread-based approaches, allowing a single machine to simulate 10k+ concurrent users. The runner spawns greenlets at the configured spawn rate and manages their lifecycle.
Uses gevent greenlets with automatic I/O patching to achieve 10-100x better concurrency than thread-based approaches, allowing 10k+ concurrent users per machine with minimal memory overhead
More memory-efficient than thread-based tools because greenlets are lightweight pseudo-threads, though less flexible than async/await because it requires gevent-compatible libraries
task weighting and random task selection for realistic user behavior
Medium confidenceImplements task execution through the @task decorator with optional weight parameter, allowing developers to define multiple tasks with different execution probabilities. The framework randomly selects tasks based on their weights (e.g., @task(3) for 3x likelihood vs @task(1) for 1x likelihood), simulating realistic user behavior where some actions are more common than others. Tasks are executed in a loop within each user's greenlet, with optional wait times between tasks. This enables modeling complex user journeys without explicit state machines.
Uses @task decorator with optional weight parameter for random task selection, enabling simple probabilistic user behavior modeling without explicit state machines
Simpler than explicit state machines for basic weighted task selection, though less flexible for complex conditional logic or state-dependent behavior
real-time web ui with live metrics dashboard and test control
Medium confidenceProvides a Flask-based REST API backend with a React frontend that displays live load test metrics, allows starting/stopping tests, and adjusts user count during execution. The web UI connects to the Environment's event system to receive real-time updates on request completion, user spawning, and test state changes. The backend serves JSON endpoints for metrics aggregation, and the React frontend polls these endpoints to update charts showing response times, throughput, error rates, and per-endpoint statistics. Users can control test execution (start, stop, pause) and modify load parameters (spawn rate, user count) through the UI without restarting the test.
Integrates Flask backend with React frontend and event-driven architecture to provide live metric updates without requiring WebSocket; allows interactive test control (start/stop/adjust load) through UI rather than CLI-only
More interactive than JMeter's GUI because it allows mid-test parameter adjustment and provides real-time aggregated metrics across distributed workers, though less polished than commercial tools like LoadRunner
event-driven hook system for test lifecycle customization
Medium confidenceImplements an event-driven architecture using EventHook pattern where custom code can subscribe to test lifecycle events (test_start, test_stop, request_success, request_failure, user_add, user_remove, etc.). Hooks are registered on the Environment object and fired at specific points in the test execution lifecycle. This enables users to inject custom logic for setup/teardown, request validation, metrics collection, and dynamic behavior without modifying core framework code. Events are fired synchronously from the runner and user greenlets, allowing hooks to modify test state or collect custom metrics.
Uses EventHook pattern with synchronous event firing to allow arbitrary Python code injection at test lifecycle points without requiring subclassing or modifying framework code
More flexible than JMeter's listeners because hooks can modify test behavior in real-time, though less type-safe than strongly-typed callback systems in compiled languages
comprehensive request statistics collection with percentile analysis
Medium confidenceCollects detailed per-request statistics through the RequestStats system, tracking response times, status codes, error messages, and request counts. Statistics are aggregated at multiple levels: per-endpoint (name), per-user-class, and globally. The framework calculates percentiles (50th, 66th, 75th, 90th, 95th, 99th) of response times using a histogram-based approach, enabling identification of tail latencies. Statistics are updated in real-time as requests complete and can be exported to CSV or HTML reports. The StatsEntry class maintains running statistics without storing individual request data, enabling memory-efficient collection of millions of requests.
Uses histogram-based percentile calculation with memory-efficient StatsEntry objects that aggregate statistics without storing individual request data, enabling collection of millions of requests without memory bloat
More detailed than basic throughput/error metrics because it provides percentile distributions, though less sophisticated than time-series databases like Prometheus for long-term trend analysis
http client abstraction with fasthttpuser for high-throughput testing
Medium confidenceProvides two HTTP client implementations: standard HttpUser using the requests library for compatibility and ease of use, and FastHttpUser using the httpx library with connection pooling and keep-alive for higher throughput. Both clients are wrapped in a statistics-collecting layer that automatically records response times, status codes, and errors. The HTTP client abstraction allows users to make requests via simple method calls (get, post, etc.) with automatic exception handling and metric collection. FastHttpUser achieves 2-3x higher throughput than HttpUser by using httpx's async-compatible connection pooling and reducing per-request overhead.
Provides dual HTTP client implementations (requests-based HttpUser and httpx-based FastHttpUser) with automatic statistics collection, allowing users to choose between compatibility and throughput without changing test code
More convenient than raw requests library because statistics are collected automatically, and FastHttpUser achieves higher throughput than standard requests due to httpx's optimized connection pooling
load shaping with custom spawn rate and user distribution strategies
Medium confidenceImplements load shaping through the LoadShape interface, allowing tests to define custom user count and spawn rate over time. The framework supports predefined shapes (StepLoadShape for gradual ramp-up, ConstantLoadShape for steady-state) and custom shapes via Python code. The UsersDispatcher component distributes target user counts across workers using a KL-divergence algorithm that minimizes the difference between target and actual distribution. Spawn rate (users per second) is controlled by the runner, which spawns greenlets at the configured rate. This enables realistic load profiles (ramp-up, plateau, ramp-down) without manual intervention.
Uses LoadShape interface with KL-divergence-based user distribution algorithm to enable custom load profiles with automatic balancing across distributed workers, allowing realistic traffic simulation without manual intervention
More flexible than fixed-rate load testing because it supports arbitrary load profiles, and more automated than manual load adjustment because distribution across workers is calculated algorithmically
protocol extensibility for non-http load testing
Medium confidenceProvides a User base class that can be extended to support custom protocols beyond HTTP. Users implement custom client logic by overriding the on_start() method to initialize connections and defining @task methods that use custom client libraries (gRPC, WebSocket, MQTT, etc.). The framework handles greenlet-based concurrency and statistics collection; custom protocol implementations are responsible for their own request/response handling. Examples include gRPC clients, WebSocket connections, and database query clients. This enables load testing of any network-based service that can be accessed from Python.
Provides User base class that can be extended for any Python-accessible protocol, with greenlet-based concurrency handling but requiring manual statistics collection for non-HTTP protocols
More flexible than HTTP-only tools because it supports arbitrary protocols, though less convenient than specialized tools like ghz for gRPC because statistics collection must be implemented manually
csv and html report generation with historical comparison
Medium confidenceExports test results to CSV and HTML formats at test completion or on-demand. CSV exports include per-endpoint statistics (response times, percentiles, error rates, request counts) in tabular format suitable for parsing and comparison. HTML reports include interactive charts showing response time distributions, throughput over time, and error rate trends. The reporting system can compare current test results with previous runs by parsing historical CSV files, enabling trend analysis and regression detection. Reports are generated from in-memory RequestStats objects and can be customized via command-line options.
Generates both CSV and HTML reports with optional historical comparison by parsing previous CSV files, enabling trend analysis without external tools
More convenient than manual metric extraction because reports are generated automatically, though less sophisticated than dedicated analytics platforms for long-term trend analysis
headless cli execution with programmatic test control
Medium confidenceSupports running load tests entirely from command-line without the web UI, controlled via CLI arguments and environment variables. The argument_parser module processes flags like --users, --spawn-rate, --run-time, --host, etc., enabling CI/CD integration without requiring browser interaction. Tests can be started, stopped, and monitored programmatically via the Environment and Runner APIs, allowing integration with orchestration tools and monitoring systems. Exit codes indicate test success/failure, enabling automated test result validation in pipelines.
Supports full headless execution via CLI arguments and environment variables with programmatic API access to Environment and Runner, enabling seamless CI/CD integration without web UI dependencies
More CI/CD-friendly than GUI-only tools because it supports headless execution, though less interactive than web UI for real-time monitoring and parameter adjustment
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with Locust, ranked by overlap. Discovered automatically through the match graph.
nicegui
Create web-based user interfaces with Python. The nice way.
GPT-Code UI
An open source implementation of OpenAI's ChatGPT Code interpreter. #opensource
k6
Developer-centric load testing tool by Grafana Labs.
AutoGPT
Autonomous AI agent — chains LLM thoughts for goals with web browsing, code execution, self-prompting.
Streamlit
Turn Python scripts into web apps — declarative API, data viz, chat components, free hosting.
prefect
Workflow orchestration and management.
Best For
- ✓Python developers building load tests for REST APIs, LLM inference endpoints, and ML model serving infrastructure
- ✓Teams wanting to treat load testing as code with full IDE support and version control
- ✓Organizations testing complex user workflows that require conditional branching and state management
- ✓Teams testing large-scale infrastructure requiring 10k+ concurrent users
- ✓Organizations with distributed systems needing geographically distributed load generation
- ✓CI/CD pipelines requiring programmatic control of distributed load tests
- ✓Teams needing to simulate 1k-10k concurrent users per machine
- ✓Resource-constrained environments where thread-based concurrency is impractical
Known Limitations
- ⚠Greenlet-based concurrency means blocking I/O in user code blocks the entire greenlet (use gevent-compatible libraries like requests or httpx)
- ⚠Python GIL can become a bottleneck for CPU-intensive task logic; distributed mode recommended for large-scale tests
- ⚠No built-in support for non-HTTP protocols without custom client implementation (requires extending User base class)
- ⚠ZMQ communication adds network latency (~5-50ms per statistics batch depending on network); not suitable for sub-millisecond precision testing
- ⚠Master becomes a single point of failure; no built-in high-availability or failover mechanism
- ⚠Worker synchronization relies on eventual consistency; brief metric inconsistencies possible during worker joins/leaves
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
About
Open-source load testing framework written in Python that allows defining user behavior with code. Scalable and distributed, it supports testing AI API endpoints, LLM inference servers, and ML model serving infrastructure under realistic traffic.
Categories
Alternatives to Locust
Build high-quality LLM apps - from prototyping, testing to production deployment and monitoring.
Compare →Amplication brings order to the chaos of large-scale software development by creating Golden Paths for developers - streamlined workflows that drive consistency, enable high-quality code practices, simplify onboarding, and accelerate standardized delivery across teams.
Compare →Are you the builder of Locust?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →