jitter: Make jitter range to current_delay instead of min_delay#184
Merged
Xuanwo merged 1 commit intoXuanwo:mainfrom Mar 19, 2025
Merged
jitter: Make jitter range to current_delay instead of min_delay#184Xuanwo merged 1 commit intoXuanwo:mainfrom
Xuanwo merged 1 commit intoXuanwo:mainfrom
Conversation
Currently in exponential and fibonacci the jitter adds a value between 0 and min_delay, which might be very small when compared to the end of the max_delay. So when reaching max_delay, and when many different endpoints use the backoff algorithm, they will hit the backends in waves This changes it to range from 0 to current_delay, so the jitter is always a relevant size compared to the delays.
Xuanwo
approved these changes
Mar 19, 2025
Owner
Xuanwo
left a comment
There was a problem hiding this comment.
Thank you @DanielShaulov, this change makes sense to me.
I find it difficult to add another configuration to adjust the jitter settings, so it's best to keep the current PR changes as they are.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently in exponential and fibonacci the jitter adds a value between 0 and min_delay, which might be very small when compared to the end of the max_delay. So when reaching max_delay, and when many different endpoints use the backoff algorithm, they will hit the backends in waves
This changes it to range from 0 to current_delay, so the jitter is always a relevant size compared to the delays.
If you prefer this to be a different parameter, let me know an I will adjust.