question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stop locusts graceful

See original GitHub issue

Proposal Add possibility to stop locusts without killing them (via Greenlet.kill). Currently executed tasks should continue, but no new tasks should be scheduled.

Motivation My load test is a bit uncommon, since I’m using some prepopulation and an additional utility database (redis), which data should be consistent with application data. So my locustfile contains something like this:

def task():
    result = self.client.post('smth').json()  # (1)
    self.redis.set('key', result['value'])    # (2)

When I press [Stop] button, a few on-the-fly tasks are interrupted between (1) and (2). Unfortunately this means that data between application and redis become inconsistent and I’m no longer able to restart test. It forces me to start my prepopulation script again and waste a lot of time.

If locust tasks were stopped graceful, allowing them to return, there would be no problem.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
cyberwcommented, Oct 19, 2019

I’m trying to add this feature in https://github.com/locustio/locust/pull/1099 . I just need to fix my bugs first 😃

0reactions
cyberwcommented, Oct 26, 2019

@xppt Did #1099 solve your issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Graceful ramp down of user load in locust - Stack Overflow
I want to run a single user for a time period of 5 minutes in a loop, but here what happens is that...
Read more >
API — Locust 2.14.0 documentation
The user can also be killed gracefully while it's sleeping, so calling this method within a task makes it possible for a user...
Read more >
How can we control locust swarms? | World Economic Forum
At best, these local measures will prevent locusts from reaching a particular area, but can do little to halt the progress of the...
Read more >
Is a plague of locusts next? What to know about the 17-year ...
Although cicadas do not bite or sting, they are not the most graceful fliers. While swarms of actual locusts can travel up to...
Read more >
Epic Catapulting Locust In Slow Motion
Locusts are powerful jumpers. ... Epic Catapulting Locust In Slow Motion ... distance in between them and any predators, and not about being...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found