Forrest logo
back to the locust tool

locust:tldr:56143

locust: Connect locust slave to master on a different machine.
$ locust --slave --master-host=${master_hostname} --host=${http:--example-com}
try on your machine

This is a command used to start a Locust test in distributed mode, with the current instance as a slave node.

The breakdown of the command is as follows:

  • locust: This is the command to start the Locust load testing tool.
  • --slave: This flag indicates that the current instance will be a slave node in a distributed setup.
  • --master-host=${master_hostname}: This flag specifies the hostname or IP address of the machine running the master node. The ${master_hostname} is a placeholder that needs to be replaced with the actual hostname or IP address.
  • --host=${http:--example-com}: This flag defines the base URL of the target system being tested. The ${http:--example-com} is also a placeholder, where http://example.com is the base URL that needs to be provided.

To run Locust in distributed mode:

  1. First, start a master node by executing locust command without the --slave flag on a desired machine. This will display the web interface of the Locust master.
  2. Then, on other machines that will be the slave nodes, execute the posted command with the actual values. Replace ${master_hostname} with the IP or hostname of the machine running the master node, and ${http:--example-com} with the actual base URL of the target system.

Upon running the command, the slave node will connect to the master node, and the load testing will be distributed between the master and slave nodes to simulate a higher load.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the locust tool