Enabling rate limits
Through Mixer, we can rate limit a service dynamically. If you are providing software as a service through a REST API for some business function, rate limits can be handy to prevent abuse of the system by users. Rules can be set to identify a user, count the number of requests, and reject requests after a limit. Rate limits allow a fair share of the system for the users.
In this example, we configure rate-limit traffic to productpage originating from the local IP address to showcase this feature. We use the x-forwarded-for request header as the client IP address and use a conditional rate limit that exempts logged-in users.
We can accomplish rate limit enforcement through the following scheme:
It creates a quota, then ...
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