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

