applying rate-limit to an API is having issues
search cancel

applying rate-limit to an API is having issues

book

Article ID: 433459

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

The requirement is to allow a maximum of 100 req/s on a single API. 

The Gateway cluster has only one GW node.

We tried to set throttling to 100 req/s on an API, with the assertion configured as follows:

(throttling_value = 100)

After the third request sent by the application within the same second, it immediately gets “429 – Too Many Requests.”

Why is this happening?

Environment

11.1

Resolution

The only option is to use the "Spread limit over X sec window" this give some room to allow request which arrive with the  1/100 second between requests

https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/api-gateway/11-2/policy-assertions/assertion-palette/service-availability-assertions/apply-rate-limit-assertion.html

Clear the check box to disallow bursts. In this scenario, the Gateway only accepts requests arriving no sooner than 

1/limit

 of a second. For example, if the 

Max requests per second

 is 100, at least 1/100 second must have elapsed between requests