NestJS · Middle · Question 71 of 75
With several app instances, why does the default throttler storage give wrong limits?
- 1Throttler doesn't work behind load balancers at all
- ✓Correct answer: It keeps counters in each process's memory, so each instance allows the full limit; a shared store like Redis fixes it
- 3Throttler counts only GET requests
Explanation
Configure a Redis storage for ThrottlerModule, and trust the proxy so the real client IP is used.