Skip to content

Commit

Permalink
Warn if spawn rate is too high. Adresses #1174 for example.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Dec 30, 2019
1 parent 6f946dc commit d9f3ba0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ def on_locust_error(locust_instance, exception, tb):
events.locust_error += on_locust_error

def start_hatching(self, locust_count=None, hatch_rate=None, wait=False):
if hatch_rate > 100:
logger.warning("Your selected hatch rate is very high (>100), and this is known to sometimes cause issues. Do you really need to ramp up that fast?")
self.hatching_greenlet = gevent.spawn(lambda: super(LocalLocustRunner, self).start_hatching(locust_count, hatch_rate, wait=wait))
self.greenlet = self.hatching_greenlet

Expand Down Expand Up @@ -355,6 +357,9 @@ def start_hatching(self, locust_count, hatch_rate):

logger.info("Sending hatch jobs of %d locusts and %.2f hatch rate to %d ready clients" % (slave_num_clients, slave_hatch_rate, num_slaves))

if slave_hatch_rate > 100:
logger.warning("Your selected hatch rate is very high (>100/slave), and this is known to sometimes cause issues. Do you really need to ramp up that fast?")

if self.state != STATE_RUNNING and self.state != STATE_HATCHING:
self.stats.clear_all()
self.exceptions = {}
Expand Down

0 comments on commit d9f3ba0

Please sign in to comment.