Web / Traefik Interview questions
How does the Retry middleware behave with failing backends?
Retry automatically resends a request to another available server in the same service when the original attempt fails at the network level, up to a configured attempt limit.
http: middlewares: retry-mw: retry: attempts: 3 initialInterval: 100ms
It only retries on connection-level failures, such as a server refusing the connection or timing out; it does not retry on a valid HTTP response with an error status like 500, since Traefik has no way to know whether that request was safely repeatable on the backend's side.
Because retries pick a different server on each attempt when possible, Retry pairs naturally with health checks and multiple replicas, since a single unhealthy instance shouldn't translate into failed requests for the client.
More Related questions...