Rate Limiting and Throttling
Rate limiting allows a certain number of requests in a given interval. Membrane API Gateway supports both limiting and throttling.
When a request is send and the rate limit is not reached the request is forwarded to the target, see figure 1. The procedure is as follows: (1) The client sends a request. (2) Membrane validates that the rate limit is not reached and forwards the request.
When a request is send and the rate limit is reached the request isn't forwarded to the target, see figure 2. The procedure is as follows: (1) The clients sends the request. (2) Membrane validates that the rate limit is reached and responds with HTTP-Statuscode 429.
The caller is informed at which time calls are allowed again when the request limit is reached.
Configuration
Figure 4 shows an example configuration for rate limiting. Requests are limited to 3 requests in 30 seconds.
Getting started
See examples/rateLimiter/README.txt in the membrane folder and try it yourself.