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

Configurable heartbeat values for workers #1897

Closed
nathan-beam opened this issue Oct 6, 2021 · 4 comments
Closed

Configurable heartbeat values for workers #1897

nathan-beam opened this issue Oct 6, 2021 · 4 comments
Labels
feature request stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it

Comments

@nathan-beam
Copy link
Contributor

nathan-beam commented Oct 6, 2021

Is your feature request related to a problem? Please describe.

Duplicating/Re-opening #1787
I keep running into heartbeat timeouts and there's only so much multi-threading and multi-processing I can do. It'd be extremely helpful to be able to configure this.

Describe the solution you'd like

IMO the option to set this from the command line isn't crucial. If we're worried about too many advanced settings being exposed, I think a good option (at least for now, until a real overhaul of the settings takes place) is to just have a setter for heartbeat liveness in the MasterRunner class and a setter for interval on the DistributedRunner

@events.init.add_listener
def on_locust_init(environment, **_kwargs):
    if isinstance(environment.runner, MasterRunner):
        environment.runner.set_heartbeat_liveness(30) # Set 30 second timeout on heartbeats
    environment.runner.set_heartbeat_interval(10) # 10 second heartbeat check/update
    some_long_task()

Describe alternatives you've considered

Manually overriding the constant works, but is certainly less than ideal

import locust.runners 
locust.runners.HEARTBEAT_LIVENESS = 30
@cyberw
Copy link
Collaborator

cyberw commented Oct 7, 2021

A quick and dirty way would be to add this as a command line variables but make it hidden.

A side note, manually overriding the constant may seem not very nice, but it is already used in other places https://docs.locust.io/en/stable/configuration.html#customization-of-statistics-settings so it it not "new", and could maybe just need to be documented.

@cyberw
Copy link
Collaborator

cyberw commented Oct 7, 2021

Also, it is better to reopen than duplicate...

@github-actions
Copy link

github-actions bot commented Dec 7, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Dec 7, 2021
@github-actions
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it
Projects
None yet
Development

No branches or pull requests

2 participants