liveBook · Manning

Locust

As explained in Enterprise RAG

Locust is an open-source load-testing tool that defines simulated users in Python and generates configurable concurrent traffic.

Locust is an open-source load-testing tool for sending configurable waves of simulated users to an API. It defines user behavior in Python, helping expose performance failures before real users encounter them. section 5.4 section 5.4.2

A practical Locust workflow includes:

  • Define a virtual user in locustfile.py, including connection, message sending, response timing, reconnect behavior, and clean shutdown. section 5.4.2
  • Configure simulated-user counts and interaction rates through Locust’s web interface, then inspect requests per second, response times, and failure rates. section 5.4.2
  • Use observed latency spikes and failures to guide scaling or capacity changes rather than relying on untested assumptions. section 5.0

Testing a WebSocket chat endpoint

A ChatUser connects to a secure wss:// endpoint, sends a JSON question, waits one to three seconds between interactions, records connection and response timings, logs failures, reconnects after socket errors, and closes the socket when stopped. section 5.4.2

How Enterprise RAG covers it

How deep it goes
Explains installation, Python user behavior, WebSocket lifecycle, dashboard configuration, and metrics, stopping short of detailed capacity modeling.
Examples
Uses a Python locustfile that repeatedly sends JSON questions through a secure WebSocket chat endpoint.
What it assumes
Assumes basic Python and a reachable API or WebSocket application, while demonstrating the Locust test structure from installation onward.
What you can do after
Diagnose performance bottlenecks by running concurrent-user tests and comparing throughput, latency, and failure metrics.
How it connects
Connects load testing with simulated users, WebSocket clients, application logging, Application Insights, and Azure App Service scaling.

Also explained in

Compare how 2 books explain Locust →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Enterprise RAG. The section links point to the parts of the book it draws on.