- Newest
- Most votes
- Most comments
As is mentioned in the last message on this stackoverflow thread, it's likely due to AWS API Gateway being Well Architected and that it does not have a single back end endpoint servicing your requests. As the author of this post mentions, when a delay is added to the request the throttle is applied more consistently.
The problems you highlight also exist for any service using a distributed Well Architected setup for throttling. Unless all the requests for the given throttling "key" land on the same host in the same moment, the system would not be able to provide perfectly consistent throttling.
The scenario you've posited, assuming the requests are distributed across multiple backend hosts, will result in the these theoretical buckets going negative after the hosts in the throttle group distribute their known information, which likely takes a few seconds. The bucket would then be replenished with the rate as requests are handled or rejected, but while the bucket is negative, all requests for that key will result in a 429 response.
Thanks, the Well Architected paradigm is something I've got to bake into my mental model of most AWS products.
I'm curious to see how accurate the burst limiting is, given these facts. If it's almost guaranteed that the bucket will "go negative", I'll try and see how negative it goes at different magnitudes:
Limit Burst Test Requests/s 10 5 30 100 50 300 1000 500 3000 We had to push this work out to a future sprint, given the discovery of the throttling behavior, so I won't be able to fully experiment for a week or so. But I promise to come back with some test results!
Relevant content
- asked 3 years ago
- asked 3 months ago
- asked 4 years ago
- asked 9 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 7 months ago
What happens if you test with thousands of threads?