pythonload-testingdistributedlocust

I'm getting a --run-time error while using locust distributed load (local)


Hello I was following this tutorial: https://youtu.be/FDYD2inSSPY?list=PLJ9A48W0kpRKMCzJARCObgJs3SinOewp5

I recreated his steps: First I created two config files:

master.conf

[master conf]
master = true
expect-workers = 1

[runtime settings]
host = https://petstore.octoperf.com
users = 3
spawn-rate = 2
locustfile = petstore.py
run-time = 30s
headless = true
only-summary = true

worker.conf

[worker conf]
worker = true
locustfile = petstore.py

I then proceed to run this two instructions in different terminals: locust --config=master.conf and locust --config=worker.conf

The first one didn't create a problem, the second one showed this error:

*/ERROR/locust.main: --run-time should be specified on the master node, and not on worker nodes

But as you can see the --run-time configuration is in the master.conf not in the worker.conf

I search in the locust documentation but I didn't find anything on this particular topic.


Solution

  • Me too.

    But...

    The solution, I deleted the run-time setting in the master configuration file. This is my configuration for master:

    locust.conf

    headless = false
    host = https://example.com
    users = 10000
    spawn-rate = 100
    web-port=8001
    

    Then I ran it in the terminal/command prompt with the command accompanied by the run-time for master like this:

    master

    locust -f mylocust.py --config=locust.conf --master --run-time=60s
    

    and for slave/worker, I just run a simple command without a configuration file:

    locust -f - --worker
    

    All goes well, this worked for me:

    enter image description here