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

Add posibility to restart workers immediately after TTL will expire #553

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

zwirek
Copy link

@zwirek zwirek commented Aug 27, 2022

Hi,
I've noticed that when ttl is set and expired then all workers are restarted in the same time. This causes bigger lag with response from ppm. It is bigger problem when bootstrap of application is heavy.

My proposal is to add another strategy to handle workers restart when ttl will expire. Workers will be restarted immediately after ttl will expire +/-5 sec. This should keep workers fresh and should prevent workers from restarting at the same time.

To enable this behavior ttl-restart-strategy cli parameter or config parameter need to be set on expire. By default ppm will restart workers due to ttl expiration only when request will be received. As it is handled in current implementation.

@andig
Copy link
Contributor

andig commented Aug 27, 2022

I think we should do this without an additional parameter. The jitter definitely makes sense.

@zwirek
Copy link
Author

zwirek commented Aug 29, 2022

I've amended the code as you suggested. I've removed additional parameter and now workers will be restarted as soon as possible when ttl expire

@andig
Copy link
Contributor

andig commented Aug 29, 2022

Would appreciate a PR review.

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

Successfully merging this pull request may close these issues.

2 participants