Answers4AWS / graffiti-monkey

Goes around tagging things
Apache License 2.0
255 stars 88 forks source link

Implemented exponential backoff for the tagging API calls. #29

Closed griffint61 closed 6 months ago

griffint61 commented 8 years ago

Adds exponential backoff for tagging API calls, and fixes a problem where the first sleep after a rate-limit exception was for zero seconds.

jesseadams commented 8 years ago

:+1:

mathieumartin-ls commented 8 years ago

This is an improvement, and is good as is. I also assume this is where most throttling happen.

But shouldn't all API calls (_conn.*) be wrapped in an exponential backoff retry? Have you experienced throttling in other parts of the graffiti-monkey run (gathering instance lists, tags & so on)?

griffint61 commented 8 years ago

Yes, in principle they should all be wrapped. But in our case graffiti-monkey is not the victim of a rate-throttling condition, it is the cause. The other API calls, like gathering instance lists, are bulk operations that don't amount to that many hits, but the tagging is not a bulk operation so there are a lot of calls in a short period. For us this triggers a rate-throttling condition and is forcing our other scripts to back off, sometimes quite a lot. This change is mean to have graffiti-monkey do it's fair share of backing off at the time it is hitting the API the hardest so that our other scripts won't have to back off quite so much.

That said, I'm all for a general solution.

sbrinkmeyer commented 7 years ago

👍 yes please we are hitting api limits because of this as well