Scrivio Interview library
ScenarioIntermediate7 min read · updated 13 November 2026

During a short slowdown of an inventory service, its traffic rose to about 9 times normal and it collapsed. Callers use Resilience4j with 3 attempts, and the mesh also applies a retry policy to the same calls.

Explain how the layers multiplied the load, and how you would set retries and timeouts between application and mesh.

Retries multiply across layers: three Resilience4j attempts, each retried by the mesh, can send nine or more requests for one user call, and they all arrive exactly when the inventory service is already slow, which turned a slowdown into a collapse. We fix it by giving each call one owner for retries, capping retries with a budget and jittered backoff, and nesting timeouts so the mesh's per-try and total timeouts fit inside the application's deadline.

Why this question is asked

Retries are the most natural resilience tool, and they work well for rare, random failures. They become dangerous when failures are caused by overload, because then every retry adds load to the thing that is failing. This scenario combines that with a second trap, two layers retrying the same call without knowing about each other. Interviewers ask it because the arithmetic is simple and the consequences are severe, and because the fix is mostly about ownership and budgets rather than a single setting. In this answer, we will reproduce the multiplication, check what the mesh does by default, decide which layer owns retries, add budgets and backoff, align timeouts, and make the amplification visible on a dashboard.

1A Quick Recap: Why Retries Hurt During Overload

A retry resends a request that failed or timed out. When a failure is random, such as a dropped connection, the second attempt usually succeeds and the user never notices. When the service is slow because it is overloaded, the second attempt lands on the same overloaded service and makes it slower still. Worse, a request that timed out on the caller's side may still be running on the server, so each retry is extra work on top of work that is not finished. This feedback loop is how a short slowdown becomes a collapse, a pattern often called a retry storm.

2How the Two Layers Multiplied the Load

Our callers use Resilience4j with maxAttempts of 3, meaning one call and up to two retries. Between the caller and the inventory service, the Istio sidecar also applies a retry policy. Each application attempt is a separate request through the proxy, and the proxy retries each of them on its own. Suppose the proxy also allows up to two retries, three attempts in total.

Java
// application: Resilience4j
resilience4j.retry.instances.inventory.max-attempts=3
resilience4j.retry.instances.inventory.wait-duration=100ms
// mesh: each of those attempts is retried by the sidecar
// attempts per user call = 3 (application) x 3 (mesh) = 9
// if a gateway in front also retries twice: 3 x 3 x 3 = 27
Step throughOne user call during the slowdown
  1. Orders calls inventory (app attempt 1)Resilience4j
  2. Sidecar sends try 1, times outthe mesh retries
  3. Sidecar tries 2 and 3, both time out3 requests so far
  4. App attempt 1 fails, Resilience4j retriesattempts 2 and 3 repeat the same pattern
  5. Total: 9 requests to inventoryfor a single user action

5 steps in order. Play them, or step through them one at a time.

So when inventory slows down and calls start timing out, each user call becomes up to 9 requests. That matches the observed traffic of about 9 times normal. The extra traffic arrives at the worst possible moment, the service falls over completely, and even requests that would have succeeded at normal load now fail. Notice that neither layer was configured badly on its own; three attempts is a reasonable number. The problem is that each layer assumed it was the only one.

3What the Mesh Does Even If You Did Not Configure It

It is easy to believe the mesh does not retry because nobody wrote a retry policy. In fact, Istio applies a default retry policy to HTTP routes: a small number of retries, two in many versions, on connection-level failures such as connect failure, refused stream and some unavailable responses. The exact conditions and counts depend on the version and on any VirtualService that overrides them, so we check what is actually in effect. Running istioctl proxy-config routes for a caller pod shows the retry policy Envoy received, and Envoy's upstream_rq_retry statistics show whether retries really happened during the incident.

4Choosing One Owner for Retries

The central decision is that each call has exactly one layer that retries. A useful split is by kind of failure. The mesh is good at fast retries of connection failures, where the request certainly did not reach the application: a refused connection or a reset before any response. Those retries are cheap and safe, and the proxy can pick a different pod. The application is the right owner for retries that need business knowledge: whether an operation is idempotent, whether it carries an idempotency key, and whether it is worth waiting for. So for inventory reads, we might let the mesh retry connect failures once and turn off application retries, or turn off mesh retries for that route and keep Resilience4j with a careful policy. What we never want is both layers retrying timeouts.

YAML
# VirtualService for inventory: the mesh retries only connection failures, once
http:
- route:
- destination: { host: inventory }
timeout: 2s # total, including retries
retries:
attempts: 1
perTryTimeout: 800ms
retryOn: connect-failure,refused-stream,reset-before-request

The reset-before-request condition needs a recent Envoy and Istio version, so check that it is supported before relying on it; connect-failure and refused-stream are long established.

5Retry Budgets, Backoff and Aligned Timeouts

Even one layer of retries can amplify load, so we cap them. A retry budget limits retries to a share of normal traffic, for example retries may add at most 10 to 20 percent to the request rate; once the budget is spent, failures are returned immediately. Envoy supports retry budgets on a cluster's circuit breakers, and in the application a circuit breaker that opens when the failure rate is high stops retries entirely. Retries must also wait, with exponential backoff and random jitter, so thousands of callers do not retry in the same millisecond.

Timeouts must nest. If the application gives the whole call 1 second but the mesh allows 3 tries of 800 ms each, the mesh keeps sending requests to inventory for up to 2.4 seconds after the application has already given up and returned an error to the user. Those requests are pure waste. The rule is that the mesh's total timeout, including all tries, must be smaller than the application's deadline, and the per-try timeout must leave room for the tries we allow.

Timeouts that nest correctly
LayerSettingValue
User request at the gatewayoverall deadline3 s
Orders service (Resilience4j)time limit for the inventory call2.5 s, no retries on timeout
Mesh route to inventorytotal timeout including retries2 s
Mesh route to inventoryper try, 1 retry on connect failure only800 ms
Each inner layer gives up before the layer that called it.

6Showing Retry Amplification on a Dashboard

Amplification is invisible if we only graph requests at the callee. We plot, for each caller and callee pair, the ratio of requests the callee received to the number of logical calls the caller made. In Istio, the standard request metrics count each try, while the caller's application metrics (for example a Micrometer timer around the inventory client) count logical calls, and Envoy's upstream_rq_retry counter counts retries directly. A ratio near 1.0 is normal; during the incident it would have shown close to 9. An alert on that ratio rising above, say, 1.5 tells us about a retry storm while it is starting.

7Follow-up questions

How would you show retry amplification on a dashboard?

Plot requests received by inventory against logical calls made by its callers, as a ratio per caller, together with the retry counters from Envoy (upstream_rq_retry and upstream_rq_retry_overflow) and Resilience4j's retry metrics. Normal is close to 1.0. Alert when the ratio climbs above about 1.5, and put the callee's latency and error rate on the same panel so the cause and effect are visible together.

Is it ever right for both layers to retry?

Only if they retry different failures and the total is still bounded. For example, the mesh retries a connection refused once, and the application retries a specific business error after a long backoff. Both retrying timeouts or 503 responses is the combination to avoid.

What should a caller do instead of retrying when the service is overloaded?

Fail fast and degrade: return a cached or partial result, show stock as unknown, or queue the work for later. A circuit breaker makes this automatic by stopping calls while the failure rate is high and letting a few test calls through after a pause.

8Conclusion

In this answer, we saw how three application attempts, each retried by the mesh, turned one call into nine and collapsed a service that was only slow. Istio's default retry policy means the mesh may retry even without explicit configuration, so we check what is in effect. The fix is one owner per call, with the mesh retrying connection failures and the application owning business-aware retries, plus retry budgets, jittered backoff and circuit breakers to cap retries, and timeouts that nest so the mesh gives up before the caller does. A ratio of received requests to logical calls makes amplification visible.

What to say in the interviewAbout 80 seconds aloud

Open with

The load multiplied because two layers retried the same call without knowing about each other. Resilience4j makes up to three attempts, and every one of those goes through the sidecar, which can retry it again, so one user call becomes up to nine requests, and they all arrive exactly when inventory is struggling.

Then, if they want more

That matches the nine times normal traffic we saw. And Istio applies a default retry policy on HTTP routes for connection-level failures even if nobody configured one, so I would check what the proxies actually have with istioctl. The fix starts with choosing one owner per call.

I usually let the mesh do a single fast retry on connection failures, where the request never reached the app, and leave business-aware retries, with idempotency keys and backoff, to the application, and I never let both retry timeouts.

Then I cap retries with a budget, say at most 10 or 20 percent extra traffic, add exponential backoff with jitter, and use a circuit breaker so callers fail fast when inventory is down.

Finally, the timeouts have to nest: the mesh's total timeout including retries must fit inside the application's deadline, otherwise the mesh keeps hammering the service after the caller has given up.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Explain how the layers multiplied the load, and how you would set retries and timeouts...": https://scrivio-interview-library.netlify.app/architecture/load-balancing-networking/c5ad0216a5/