Throttling
Once an API is deployed to a stage, we can enable throttling, which restricts the number of times the API can be called. This can be configured as a blanket rule that applies to all the requests made to the API or by allocating a quota of requests that a client can be allowed to make. Client-specific throttling is configured through a usage plan.
We created a Greeter-Usage-Plan in Chapter 3, Designing a Kotlin Serverless Application. Let's extend that to introduce throttling.
In the details tab of the Greeter-Usage plan, we show a list of associated API stages.
Clicking on the Configure Method Throttling option yields a popup where we can enter the Rate (requests per second) and the burst for a particular method:
Specify a request ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access