Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

number locusts must be a multiple of the number of slaves #112

Closed
sanga opened this issue Nov 28, 2013 · 9 comments
Closed

number locusts must be a multiple of the number of slaves #112

sanga opened this issue Nov 28, 2013 · 9 comments

Comments

@sanga
Copy link
Contributor

sanga commented Nov 28, 2013

We have 80 slaves in our set up and this is somewhat restrictive at times i.e. at times it would be nice step in finer jumps than 80 (of course I could kill some slaves, but that's a bit clunky)

@heyman
Copy link
Member

heyman commented Nov 28, 2013

Ah, I see.

The reason for the current behaviour is just simplicity/laziness (easier to just order each slave to spawn the same number of locust users) and I think I was reasoning that when you have a really high number of slave machines, you're likely to also have them run many more magnitudes of locust users so it shouldn't matter.

However, it shouldn't be very hard to modify the code in MasterLocustRunner.start_hatching (

def start_hatching(self, locust_count, hatch_rate):
) to make it either not use all slaves if the number of users < number of slaves. Or if users > slaves but users aren't an even multiple of slaves, distribute the number of users as evenly as possible, but not the same amount to each slave. I also think that would be an improvement :).

Jahaja pushed a commit that referenced this issue Nov 28, 2013
@Jahaja
Copy link
Member

Jahaja commented Nov 28, 2013

Fixed in the commit referenced above.

I just distributed the remaining locusts by adding one locust for each slave until theres no more locusts left to distribute.

@Jahaja Jahaja closed this as completed Nov 28, 2013
@sanga
Copy link
Contributor Author

sanga commented Dec 2, 2013

Just got around to having a look at this afternoon. Thanks for the speedy fix!

@heyman
Copy link
Member

heyman commented Dec 2, 2013

Great!

I found a small bug when testing this out. If one tried to spawn fewer locusts than the number of connected slaves, we would still spawn one user per slave. I've fixed this is fb2bd53. It's a one line fix and ~20 lines test, plus two other tests I wrote while debugging it :).

@Jahaja
Copy link
Member

Jahaja commented Dec 2, 2013

Excellent!

@sanga
Copy link
Contributor Author

sanga commented Dec 3, 2013

yeah, I spotted that too but figured I'd have a go at fixing it rather than complaining about a (somewhat) nitpicky thing. Thanks for beating me to it ;)

@sanga
Copy link
Contributor Author

sanga commented Dec 3, 2013

Actually this still looks a little broken in current master. I've seen that at least the number of locusts can overrun what you ask for. I'll do a bit more digging today if I can dig out the root cause or at least narrow it down a bit.

@abhimanyuPlivo
Copy link

Is this issue still persisting? I have 16 Slaves in my setup and have 30 different types of users defined. Seems like the minimum load I can run is with 16 * 30 = 480 locusts.

@wreed4
Copy link

wreed4 commented Mar 5, 2019

This is definitely still an issue for me, but it doesn't seem as clear cut. I was running with 10 slaves, 100 Locust classes in my locustfile (because I need to hit 100 different hosts) and the minimum number of users I can run with is 501. 500 or less spawns zero users. It might also have to do with the spawn rate. The logs of each slave say "spawning 0 clients with hatch rate of 0.2 cl/sec" or something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants