Distributed Locust Load Testing on Local Machine

I was wondering is it possible to run locust distributed on the local machine? I mean to create slaves and master locally. I tried next:

Master:

> locust --master

Slaves:

> locust --slave --master-host=127.0.0.1 --master-port=8089

But I am getting the error:

You are running in distributed mode but have no slave servers connected. Please connect slaves prior to swarming.

1 Answer

Yes, it is possible to run locust distributed on the local machine. Note that you don't need to provide master-host parameter as it defaults to 127.0.0.1.

First, open the terminal and start the master using this command:

locust -f load_test_script.py --master

Then start slaves, each in a new terminal window:

locust -f load_test_script.py --worker

For optimal performance, the number of slaves on the local machine should not excide the number of CPU cores. Check official documentation for more info about running locust in distributed mode.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest