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

Why "equal jitter" is named "full jitter"? #46

Open
qrilka opened this issue Aug 2, 2016 · 1 comment
Open

Why "equal jitter" is named "full jitter"? #46

qrilka opened this issue Aug 2, 2016 · 1 comment

Comments

@qrilka
Copy link
Contributor

qrilka commented Aug 2, 2016

Full jitter from the article should work like

sleep = random_between(0, min(cap, base * 2 ** attempt))

and

temp = min(cap, base * 2 ** attempt)
sleep = temp / 2 + random_between(0, temp / 2)

using in the package is name "equal jitter"
Also / is not escaped in comments so formula gets rendered incorrectly.
I could create PR with a fix but that would be a breaking change as the algorithm will change.

@roberth
Copy link

roberth commented Aug 23, 2021

It's not even equal jitter, because the cap can only be applied without jitter using capDelay. It's more like

temp = base * 2 ** attempt
sleep = min(cap, temp / 2 + random_between(0, temp / 2))

or eqv

sleep = min(cap, (0.5 + random_between(0, 0.5)) * base * 2 ** attempt)

producing no jitter at all when base * 2 ** attempt reaches 2 * cap.

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

No branches or pull requests

2 participants