Rate Limiting calls per client AND total calls across clients possible?

Hi,

We are currently using Traefik, but are unsure if the following scenario is supported.

  1. Rate limiting per client calling a given route, so each client can only call 100 times per minute lets say.
  2. At the same time, also limit the total amount of calls for a given route across clients to 1000 per minute

In practice this would mean that 1. ensures each client does not starve the other while 2. ensures overall throttling/limit on a given resource in a time period.

Is this at all possible with Traefiks RateLimit middleware, or is only part 1. possible?

It sounds like you are going pro, not sure if the middleware will work across multiple Traefik instances.

So you might need to create your own plugin, to have a central counter for example in Redis, to be used by a Traefik cluster.

THe issue is not the amount of Traefik instances. It is just if it is possible to solve both 1 and 2 - even with a single instance of Traefik.

You can try to assign two middlewares to the router, for second one group all IPs.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.