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

Revisit backoff logic #69

Closed
tehranian opened this issue May 31, 2016 · 3 comments
Closed

Revisit backoff logic #69

tehranian opened this issue May 31, 2016 · 3 comments
Projects
Milestone

Comments

@tehranian
Copy link

tehranian commented May 31, 2016

Was looking through the backoff logic after we hit some "ProvisionedThroughputExceededException" errors. We see the following issues:

From

def calc(count)
(2 ** count) * scaling_factor
end
def scaling_factor
0.3 + (0.5-rand) * 0.1
end
:

  • scaling_factor is always going to be a number between 0.25-0.35. That is not a very wide spread.
  • Given that the default number of retries is 3 and the scaling factor is relatively narrow, calc(count) for counts {0,1,2} is going to return backoffs of approximately 0.5 sec, 1 sec, and 2 seconds, respectively. Therefore a temporary (~5 second) spike in traffic could cause records to be dropped via a ProvisionedThroughputExceededException, by the default configuration.

We're getting around this by setting retries_on_batch_request to 7 in order to give ourselves 30+ seconds of retries, but I think that one could reasonably argue that the defaults here for backoffs & retries are not great.

@riywo
Copy link
Contributor

riywo commented Jun 1, 2016

Hi @tehranian ,

Thank you for your feedback from the real world. I'll consider to change the default value, but it is an incompatible change which will affect to all users who use the default value. So, I'll update it when I bump the major version.

By the way, do you need more configurable parameters to adjust backoff logic, such as base_of_scaling_factor?

@tehranian
Copy link
Author

Hi @riywo ,

re: changing the behavior w/a major version bump - Yea that makes sense.

re: more configurable parameters - Yea, I was going to suggest something like this. Seems ok to me. Or just clearly document to folks in the README section for retries_on_batch_request what the behavior of the default retry configuration will result in.

@riywo riywo added this to the 2.0.0 milestone Jun 11, 2016
@riywo riywo added this to TODO in 2.0.0 Feb 2, 2017
@riywo riywo moved this from TODO related to Design to TODO related to Feature in 2.0.0 Feb 2, 2017
@riywo
Copy link
Contributor

riywo commented Mar 13, 2017

#112

@riywo riywo closed this as completed Mar 13, 2017
@riywo riywo moved this from TODO related to Feature to DONE in 2.0.0 Mar 13, 2017
@riywo riywo mentioned this issue Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
2.0.0
DONE
Development

No branches or pull requests

2 participants