API Testing · Senior · Question 41 of 75
How do you test that an API rate limiter works across several instances?
- 1Spread requests across instances and check the shared limit holds
- 2Send all requests to one instance and check its local count
- 3Rate limiters work the same on one instance, so no test is needed
Show the answer
Correct answer: Spread requests across instances and check the shared limit holds
Explanation
In-memory limiters per instance multiply the real limit by the instance count. Distributed limits need a shared store and tests that hit several nodes.