Web / Traefik Interview questions
When should you use the RateLimit middleware?
RateLimit throttles how many requests a client can send in a given time window, protecting backends from being overwhelmed by traffic spikes, abusive clients, or runaway retry loops from a misbehaving caller.
http: middlewares: limit: rateLimit: average: 100 burst: 50
average sets the steady-state requests-per-second budget, and burst allows short spikes above that average before requests start getting rejected with a 429 status, which is useful for legitimate bursty traffic that would otherwise be needlessly throttled.
It's commonly placed early in a middleware chain, often right after or alongside authentication, so that rejected requests are dropped cheaply before reaching more expensive processing further down the chain.
More Related questions...