Open radekmie opened 2 years ago
My use case for Router-based rate-limiting would definitely benefit from a shared rate-limiting state. Currently, as new Router instances are spun up in a multi-instance deployment, clients would effectively have their rate limit scale up as well. Enforcing the rate limit across all instances of the Router seems like it would be an ideal way to mitigate that problem.
As @lennyburdette said in https://github.com/apollographql/router/issues/1347#issuecomment-1200876058, the current implementation of rate limiting is a global one, not a per client one. I think it's a good idea to have the latter in the Router as well.
An idea of what the configuration could look like (heavily inspired by
global_rate_limit
):