Could I make my server crashed with Locust?

63 views Asked by At

I am looking for a scalable load-generating tool. Many tools like Vegeta adjust loads according to the response from the server. So I couldn't see if my server would be crashed with a huge load. It was helpful to see the max throughput of my server but it does not guarantee that it would not crash upon more loads than it can handle. Could I send a fixed level of loads with Locust? I am looking into documentation but it's not clear to me.

1

There are 1 answers

2
Cyberwiz On

Yes and no. Locust always launches a specific number of concurrent users, and cannot spawn new ones if your server slows down (at least not without serious hacking/workarounds)

However, you can achieve the same thing by limiting users to a certain rate.

Lets say you want to test 100 requests/s.

Assuming your service would never take >20s to serve a request (or to be specific: complete a locust task), you can set wait_time = constant_pacing(20), and launch 2000 users (100rps*20s => 2000 users).

In the unlikely event that your server is still working, but really slowly (>20s) you can just increase the wait time and increase the number of users further.

See https://docs.locust.io/en/stable/api.html#locust.wait_time.constant_pacing for more info.