locust
locust copied to clipboard
I am using the custom client for my project. I want to load test with distribution of workers. But to start 10 workers, I need to start typing command "locust -f main.py --worker" for ten times. why do not locust have a new feature to run it in the single command like "locust -f ... --workers 10"?
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
in order to have multiple workers you should run workes in separate processes (in order to properly utilize cpu power).
simple bash script will be handy:
export LOCUST_HOST="https://example.com"
for i in {1..$1}; do
( locust --worker & )
done
locust --master --expect-workers=$1
This can already be done with docker compose. There’s an example compose file you can find here https://github.com/locustio/locust/blob/master/examples/docker-compose/docker-compose.yml. There are lots of resources elsewhere about how docker compose works and how to use it. Here’s one example:
https://docs.docker.com/compose/gettingstarted/
When using docker compose you can use --scale worker=10
and it will automatically start 10 different workers for you.
I’d love for this to be a feature. Should be pretty easy to do using Pythons multiprocessing
, but I have no experience with it. Anybody wanna have a go at it?
@cyberw I think you can relatively easy achieve that starting from Using locust as a library
Sure, but I’m talking about building it as a standard feature (using command line arguments/main.py). I’m just trying to get someone else to do it for me, instead of doing everything myself :)
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.
@Sawiq Can you post sample code to configure master and slave when running locust as library and want to generate test in distributed mode.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity. This does not necessarily mean that the issue is bad, but it most likely means that nobody is willing to take the time to fix it. If you have found Locust useful, then consider contributing a fix yourself!