1

We had put a rate limit and burst limit on our API endpoint, but we still seeing the requests failing with error "Too many requests" on going through the docs it mentioned if rate limit and burst limit are not set according.

API Gateway throttling -- burst limit vs rate limit

Is there a way to calculate the burst and rate limit on the basis of incoming requests.

sudipt dabral
  • 1,335
  • 2
  • 9
  • 17
  • there is no such way to calculate it. It all depends on your business traffic. You can use cloudwatch metrics to identify the number of invocations to your api gateway and then set an appropriate number for rate and burst limit. If the incoming traffic is more than the limits set then you will get 429 error – node_saini May 29 '22 at 06:58
  • @node_saini, say i have a peak traffic of 80k requests in a minute,what would be a good number for limits and how do you reach there if you can share. – sudipt dabral May 30 '22 at 08:41
  • 1
    try to understand `https://en.wikipedia.org/wiki/Token_bucket` based on which the throttling works. APIG has 10k/sec quota so throttle will also happen on a second basis. See if you can get traffic details per second. Let's say your 80k traffic is evenly distributed so you can go with a rate of 1500(80k/60+Buffer). Burst again depends on how many concurrent calls you want to allow so it's up to you. You can keep it 200, 300, 400 etc. – node_saini Jun 03 '22 at 11:03

0 Answers0