A retry storm across a five-service call chain: proving retry amplification with distributed traces and metrics, stopping it during the incident, and preventing it with single-layer retries, retry budgets, Retry-After, circuit breakers and jitter.
The signature of a retry storm is downstream traffic rising while user traffic is flat. Each layer retries its own failures, so load multiplies. A layer with three retries makes up to 4 attempts per call it receives. Stack four such layers and the bottom sees 4 × 4 × 4 × 4 = 256 calls for one user request, aimed at the service that is already struggling. In general that is (1 + r)^n.
I prove it with distributed traces (dependency spans per operation_Id in Application Insights) and Polly retry telemetry. To stop it, I cut retries through configuration, let circuit breakers open and shed load at the bottom so the dependency can recover. The lasting fix: retry in one layer only, enforce a retry budget (retries at most ~10% of calls), honour Retry-After, and use jitter. The trade-off: fewer retries means a few more user-visible errors in small blips, in exchange for never amplifying a big one.
"The clue in that symptom is the ratio. If inventory gets eight times normal traffic while users send the same amount, the extra traffic is being created inside our own system, and retries are the usual cause. A retry storm happens when every layer in a call chain has its own retry policy. A gateway, a BFF, orders, pricing and inventory each retrying three times means a failure at the bottom is multiplied at every level. Four retrying layers is 4 to the power of 4, which is 256 attempts for one click, all arriving at the service that's already slowest.
For example, at [company] we [had exactly this: a SQL slowdown under inventory became a 45-minute outage]. I proved it in Application Insights by counting dependency calls per operation ID. Normal requests had about 4 spans. During the incident some had over 100, with the same call repeated at different levels. Polly's retry metrics showed retries were [more than 70%] of inventory's traffic. To stop it, we cut retries to zero above orders through App Configuration, which took effect in about 30 seconds without a deploy. Inventory's circuit breaker could then open and the database recovered within [3 minutes]. The lasting fix was a rule: one retrying layer per call chain, a retry budget so retries can never exceed about 10% of calls,
Retry-Afterhonoured everywhere, and an alert on retry share.The mistake I see is thinking each team's retry policy is reasonable on its own, so the system must be fine. Each policy is reasonable. Stacked together, they amplify. Retries are a shared resource, and you have to budget them."
User ──► Gateway ──► BFF ──► Orders ──► Pricing ──► Inventory ──► SQL (slow)
r=3 r=3 r=3 r=3 (fails)
attempts reaching inventory per user request:
Pricing: 1 + 3 = 4
Orders: 4 × 4 = 16
BFF: 16 × 4 = 64
Gateway: 64 × 4 = 256
| Evidence | Tool | What it shows |
|---|---|---|
| Inventory rps vs gateway rps | Azure Monitor / App Insights metrics | Internal amplification (8× while users flat) |
| Dependency spans per operation | App Insights KQL on dependencies grouped by operation_Id |
Repeated calls in one trace |
| Retry share | Polly v8 metrics (resilience.polly.strategy.events, retry events) |
Retries as % of calls |
| SQL waits and DTU | Query Store, Azure SQL metrics | The original slowdown and its recovery |
| Rule | Mechanism |
|---|---|
| One retrying layer per chain | Remove retries above the layer nearest the dependency; others fail fast |
| Retry budget | Token bucket: each success adds 0.1 token, each retry costs 1, so retries stay at or below ~10% |
| Respect overload signals | Honour Retry-After; do not retry 503 from load shedding immediately |
| Breaker below the retry | Open circuits fail retries instantly |
| Jitter | Spread retries so they don't arrive in synchronised waves |
In the incident above, gateway traffic held steady at about 1,200 rps while inventory went from 900 to 7,400 rps. After moving to a single retrying layer and a 10% budget, a similar SQL slowdown three months later peaked at 1,050 rps to inventory, the breaker opened for 20 s, and user-visible errors lasted 90 seconds instead of 45 minutes.
Checks whether the candidate can recognise internal load amplification, prove it with telemetry, act calmly during the incident, and fix the system rather than one service.
Green flags
Red flags
A retry is only useful if the failure is transient and the dependency has spare capacity for the extra attempt. In a storm, neither is true: the failure is overload, and retries add more load. Retrying makes recovery impossible while the extra load lasts, which turns a brief slowdown into a stable outage. This feedback loop is sometimes called a metastable failure: the system stays broken after the original trigger has gone.
SQL slows ──► inventory times out ──► callers retry ──► more load on inventory
▲ │
└─────────────── SQL slower still ◄────────────────────────┘
A retry budget caps retries as a share of normal traffic. The common implementation is a token bucket per client process:
In steady state, retries can't exceed about 10% of calls. In a storm the bucket drains in seconds and retries stop by themselves, while one-off blips still get retried.
gRPC has this built in: RetryThrottlingPolicy in the client service config (MaxTokens, TokenRatio) follows the same idea, and the .NET gRPC client supports it. Service meshes (Envoy-based) offer retry budgets as configuration. For HTTP with Polly v8 there is no built-in budget, so you implement it in the retry ShouldHandle predicate, as in the code example.
Retry closest to the failing dependency, where the error is best understood and the cost of a retry is smallest. Every layer above fails fast and passes the error up, ideally as a 503 with Retry-After. The exception is the very edge (mobile app or SPA), where a user-initiated retry with backoff is fine because it is naturally rate-limited by people.
In Application Insights, every dependency call carries the operation_Id of the user request. Counting dependency calls per operation to the same target shows repeated attempts:
dependencies
| where timestamp between (incidentStart .. incidentEnd)
| where target has "inventory"
| summarize calls = count() by operation_Id
| summarize p50 = percentile(calls, 50), p99 = percentile(calls, 99), max = max(calls)
Compare with the same query for a normal hour. A p99 of 1–2 normally and 64+ during the incident is the proof.
Retry-After) so it serves some requests well.AddStandardResilienceHandler on each hop. Make the bottom one fail 50% of calls and count calls with a counter middleware.RetryThrottlingPolicy and observe throttled retries in the logs.A per-client retry budget enforced in Polly v8's ShouldHandle, used by the single retrying layer, and fail-fast clients above it.
// RetryBudget.cs: retries can never exceed ~10% of calls from this process.
namespace Inventory.Resilience;
public sealed class RetryBudget(double tokenRatio = 0.1, double maxTokens = 100)
{
private readonly Lock _gate = new();
private double _tokens = maxTokens;
// Every first attempt earns a fraction of a token.
public void RecordAttempt()
{
lock (_gate) _tokens = Math.Min(maxTokens, _tokens + tokenRatio);
}
// A retry spends one token; with none left, we fail instead of amplifying.
public bool TryWithdraw()
{
lock (_gate)
{
if (_tokens < 1) return false;
_tokens -= 1;
return true;
}
}
}
// Program.cs in Pricing (the ONE retrying layer, closest to Inventory)
using Inventory.Resilience;
using Microsoft.Extensions.Http.Resilience;
using Polly;
var builder = WebApplication.CreateBuilder(args);
var budget = new RetryBudget();
builder.Services.AddHttpClient("inventory", c => c.BaseAddress = new Uri("https://inventory.internal"))
.AddResilienceHandler("inventory", pipeline =>
{
pipeline.AddTimeout(TimeSpan.FromSeconds(2)); // total budget for this hop
pipeline.AddRetry(new HttpRetryStrategyOptions
{
MaxRetryAttempts = 2,
UseJitter = true, // de-synchronise retry waves
ShouldRetryAfterHeader = true, // respect the server's overload signal
ShouldHandle = args =>
{
if (args.AttemptNumber == 0) budget.RecordAttempt();
var transient = HttpClientResiliencePredicates.IsTransient(args.Outcome);
// Retry only transient failures AND only while the budget allows it.
return ValueTask.FromResult(transient && budget.TryWithdraw());
}
});
pipeline.AddCircuitBreaker(new HttpCircuitBreakerStrategyOptions
{
FailureRatio = 0.3, MinimumThroughput = 50, BreakDuration = TimeSpan.FromSeconds(20)
});
pipeline.AddTimeout(TimeSpan.FromMilliseconds(500)); // per attempt
});
var app = builder.Build();
app.Run();
// Program.cs in Orders / BFF / Gateway: NO retries, fail fast and pass the 503 up.
builder.Services.AddHttpClient("pricing", c => c.BaseAddress = new Uri("https://pricing.internal"))
.AddResilienceHandler("pricing-fail-fast", pipeline =>
{
pipeline.AddTimeout(TimeSpan.FromSeconds(3)); // > pricing's 2 s, < our caller's
pipeline.AddCircuitBreaker(new HttpCircuitBreakerStrategyOptions
{
FailureRatio = 0.3, MinimumThroughput = 50, BreakDuration = TimeSpan.FromSeconds(20)
});
});
Retry-After with jitter, and count the retry against a budget.UseJitter = true on exponential backoff.The senior lesson is that a slowdown triggered this incident, but amplification made it last. In the post-incident review I separate the two, because fixing only the database leaves the amplifier waiting for the next trigger. Retries still have a job: for genuinely transient faults (a dropped connection, a single pod restarting, a brief failover) with spare capacity downstream, one retry turns a user-visible error into a slightly slower success. The budget keeps exactly that benefit. In normal operation a 1–2% failure rate is retried in full, and only when failures go past the budget do retries stop.
Retries are a shared resource across teams, so the fix is partly governance: a timeout and retry budget per call chain, owned by the platform or architecture group, checked in code review, and visible on a dashboard of retry share per dependency. In .NET 10 the pieces are standard. Microsoft.Extensions.Http.Resilience pipelines (Polly v8) emit retry and breaker events through System.Diagnostics.Metrics, which OpenTelemetry exports to Azure Monitor. HttpRetryStrategyOptions.ShouldRetryAfterHeader honours server back-off, and Azure App Configuration with refresh gives on-call a live lever for retry counts. I measure success by recovery time after the trigger ends. Without amplification, the system should recover within a minute of the dependency recovering. If it stays broken, something is still feeding the loop.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| Single retrying layer | Every synchronous call chain | Coordination across teams | Never skip it |
| Retry budget (token bucket) | High-traffic clients | A little code, or mesh config | Very low-traffic clients where the bucket never fills; use a small fixed cap |
| gRPC RetryThrottlingPolicy | gRPC clients | Service config only | HTTP clients (no equivalent built in) |
| Mesh retry budgets (Envoy, Istio) | Polyglot estates with a mesh | Mesh complexity; hidden from code | When code also retries |
| Hedging | Tail latency on idempotent reads | Extra load by design | During overload; budget it or turn it off |
Retry handles transient faults: a network blip, 503, 429 or a timeout that will probably succeed if you try again shortly.
Retry-After), connection errors and timeouts. Never retry 400, 401, 403, 404, 409 or validation failures.The danger is amplification: retries at the API, service and client layers multiply, which creates a retry storm against a recovering dependency. Retry at one layer and pair it with a circuit breaker.
In .NET 10 it's Polly v8 (AddRetry) or AddStandardResilienceHandler (3 retries, exponential, jitter, 2 s base). The trade-off is higher success rates against extra load and latency.
Resilience strategies are wrappers, so order decides what each one sees. The order I use, outer to inner, is the one in AddStandardResilienceHandler: concurrency limiter → total timeout → retry → circuit breaker → per-attempt timeout. The total timeout caps the whole operation, retry delays included. The retry wraps the breaker, so every attempt counts towards the breaker's failure ratio, and once the breaker opens the retries fail at once instead of hammering. The attempt timeout sits innermost, so a hung call becomes a fast, retryable failure.
Across services, timeouts form a budget: each hop must give up before its caller does. You also propagate the deadline, so work stops when nobody is waiting for it. The trade-off: every retry layer you add improves the odds for one call but multiplies load on the dependency when it is already struggling.
An overloaded service with unbounded queues collapses: requests wait so long that many time out after the server has done the work, so goodput (successful responses that arrive in time) falls towards zero while CPU stays at 100%. Load shedding means rejecting excess work early and cheaply so the work you accept finishes in time.
In ASP.NET Core I use the rate limiting middleware (AddRateLimiter / UseRateLimiter) with a concurrency limiter sized by Little's law (concurrency = throughput × latency, measured at the healthy limit) and a small queue. Rejected requests get 503 with Retry-After, or 429 when a single client is over its quota. I shed by priority: checkout before batch exports, health probes never. Clients must honour Retry-After and back off with jitter.
The trade-off: you deliberately fail some users to keep the system serving most of them.
How to tell it (STAR)
**S:** At [company], a slow SQL query under our inventory service turned into a [45-minute] checkout outage, even though the query was fixed in [10 minutes]. **T:** I was incident lead and then owned the follow-up. **A:** I noticed inventory traffic had gone up eightfold while user traffic was flat, so I counted calls per operation in Application Insights and found over a hundred inventory calls for a single user request. Every service was retrying three times. We turned retries off above pricing through App Configuration, the breaker opened and the database recovered in [about 3 minutes]. Afterwards I introduced one retrying layer per call chain, a 10% retry budget and an alert on retry share. **R:** A similar slowdown three months later caused [90 seconds] of errors instead of 45 minutes, and retries never went above [8%] of traffic.
Last updated 23 Nov 2026.