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 ...

Get Hands-On Serverless Applications with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.