explaingit

locustio/locust

📈 Trending27,794PythonAudience · developerComplexity · 3/5ActiveLicenseSetup · easy

TLDR

Open-source load testing tool that simulates thousands of concurrent users hitting your website to find performance bottlenecks. Write tests in Python code instead of a GUI.

Mindmap

mindmap
  root((Locust))
    What it does
      Simulates user swarms
      Finds bottlenecks
      Tests web services
    How to use it
      Write Python code
      Define user behavior
      Spawn virtual users
    Monitoring
      Web dashboard
      Real-time stats
      Adjust load live
    Tech details
      Lightweight concurrency
      HTTP and custom protocols
      Headless mode available

Things people build with this

USE CASE 1

Verify your website can handle expected traffic before launch by simulating thousands of concurrent users.

USE CASE 2

Identify slow pages and performance bottlenecks by running load tests and analyzing response times.

USE CASE 3

Automate load testing in CI/CD pipelines using headless mode without needing a GUI.

USE CASE 4

Test custom protocols and APIs by writing Python code to define realistic user behavior patterns.

Tech stack

PythonHTTPWeb dashboard

Getting it running

Difficulty · easy Time to first run · 5min
Open-source tool available under the LGPL license, allowing free use and modification for testing purposes.

In plain English

Locust is an open-source load testing tool that lets you check how well your website or web service holds up under pressure. Load testing means simulating many users hitting your site at the same time to find bottlenecks, the breaking points where your server slows down or crashes. The name "locust" refers to a swarm, which is exactly what it simulates: many users descending on your service simultaneously. What makes Locust different from other tools is that you write your test scenarios in plain Python code rather than clicking through a GUI or writing in a special language. You define a "user" class that describes what a virtual user does, logging in, browsing pages, submitting forms, and Locust spawns thousands of these virtual users simultaneously. Because each user runs inside a lightweight concurrency mechanism, a single computer can simulate a massive number of concurrent users. Locust comes with a web-based dashboard you can open in your browser to watch the test run in real time, seeing stats like response times, throughput (requests per second), and error rates. You can even adjust the number of simulated users while the test is running. It also works headlessly (without the UI) for use in automated testing pipelines. You would use Locust when you are about to launch a product and want to verify it can handle expected traffic, or when you suspect a slow page and want to find the cause. It is written in Python and supports HTTP as well as other protocols with custom clients.

Copy-paste prompts

Prompt 1
Show me how to write a Locust test that simulates users logging in and browsing product pages on an e-commerce site.
Prompt 2
How do I run a Locust load test headlessly in my CI/CD pipeline and export the results as JSON?
Prompt 3
Write a Locust user class that makes realistic requests to a REST API with think time between requests.
Prompt 4
How do I use Locust's web dashboard to monitor response times and error rates while adjusting the number of users in real time?
Prompt 5
Create a Locust test for a custom protocol that isn't HTTP, using a client library I already have.
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.