-
Notifications
You must be signed in to change notification settings - Fork 387
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
Consider offering a full jitter backoff policy #8755
Comments
For some services (storage comes to mind) a minimum back off is recommended. |
@dbolduc is going to research some more and make a recommendation. |
This is the code to run the simulation in the article: https://github.com/aws-samples/aws-arch-backoff-simulator/blob/master/src/backoff_simulator.py I added our backoff algorithm: 34a35,39
> class ExpoBackoffCloudCpp(Backoff):
> def backoff(self, n):
> v = self.expo(n)
> return random.uniform(v/2, v)
> And a MinJitter (i.e. full jitter, but it doesn't start at 0) 39a45,49
> class ExpoBackoffMinJitter(Backoff):
> def backoff(self, n):
> v = self.expo(n)
> return random.uniform(self.base, v)
> To summarize (with these exact settings, in this exact model), min jitter is indistinguishable from full jitter. Our strategy is indistinguishable from the jitter strategies in terms of total calls, but takes more time to complete the work. I will phone a friend before making a recommendation... |
Seems like other client library languages do full jitter only. Given the supposed, slight performance benefit, I think we should implement min-jitter (which is like full jitter, but slightly more general). I think we should modify the implementation of the existing I think our default backoff policy should use full jitter. BackgroundOur API accepts three parameters:
google-cloud-cpp/google/cloud/internal/backoff_policy.h Lines 125 to 128 in 9737c4b
Aside: I don't agree with the range it sets. I think we should multiply by
Min-jitter requires four parameters:
Design / Work:I would break up the work into two PRs: 1. Implement min-jitter
2. Update library defaults
We want the We want the value of the "Running the generator" means: ci/cloudbuild/build.sh -t generate-libraries-pr It may also be useful to generate only the "golden" files. (instead of 100 libraries). This just speeds up development cycles. env GENERATE_GOLDEN_ONLY=1 ci/cloudbuild/build.sh -t generate-libraries-pr |
- Add a test for floating point numbers - Clarify the naming of current_delay_range_ by adding two parameters (one for the start and one for the end). In the long term we can remove this since we want to implement min jitter in issue googleapis#8755. Then the current_delay_start_ will always equal the initial_delay_.
- Use () around min and max to avoid macro expansion - Add a test for floating point numbers - Clarify the naming of current_delay_range_ by adding two parameters (one for the start and one for the end). In the long term we can remove this since we want to implement min jitter in issue googleapis#8755. Then the current_delay_start_ will always equal the initial_delay_.
Can we close this? |
Yes |
Here is a write up on full jitter. Apparently the java clients do this.
With pure exponential backoff policy we might have backoff ranges like:
req1: (.5, 1)
req2: (1, 2)
req3: (2, 4)
....
With full jitter, these backoff ranges would look like:
req1: (0, 1)
req2: (0, 2)
req3: (0, 4)
....
(make up your own units)
The text was updated successfully, but these errors were encountered: