Add posibility to restart workers immediately after TTL will expire #553
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 onexpire
. By default ppm will restart workers due to ttl expiration only when request will be received. As it is handled in current implementation.