Skip to content

Commit 30e299e

Browse files
committed
Final editing pass backpressure-load-shedding-admission-control-overload article
1 parent 184dea5 commit 30e299e

2 files changed

Lines changed: 135 additions & 47 deletions

File tree

  • src/content/articles/backpressure-load-shedding-admission-control-overload

‎src/content/articles/backpressure-load-shedding-admission-control-overload/index.mdx‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ I watched an e-commerce platform collapse during a flash sale. Traffic spiked to
2424

2525
The fix wasn't more capacity. It was teaching the system to say "no."
2626

27-
Most systems don't fail because they can't handle load. They fail because they try to handle _all_ the load. Without explicit overload handling, a system accepts work it cannot complete, queues grow unbounded, and what starts as a traffic spike becomes a prolonged outage.
27+
<Highlighter>Most systems don't fail because they can't handle load.</Highlighter> They fail because they try to handle _all_ the load. Without explicit overload handling, a system accepts work it cannot complete, queues grow unbounded, and what starts as a traffic spike becomes a prolonged outage.
2828

2929
<Callout type="warning">
3030
A system without backpressure will accept work until it collapses. The goal isn't handling unlimited load — it's handling your design capacity reliably and degrading gracefully beyond it.
@@ -38,6 +38,7 @@ Overload doesn't just make systems slow — it makes them _worse_. There's a vic
3838

3939
<Diagram
4040
src={cascadingFailureDiagram}
41+
size="2xl"
4142
title="The cascading failure loop where overload compounds itself through retries and resource exhaustion"
4243
description="Flowchart showing the feedback loop that turns overload into a full outage. A Traffic Spike leads to Queue Growth, which leads to Latency Increase. Increased latency causes Client Timeouts, which trigger Client Retries, sending more traffic back into the original spike and reinforcing the cycle. A second branch from Latency Increase leads to Resource Exhaustion, then Thread Pool Saturation, then Connection Pool Exhaustion, and finally Complete Failure. The diagram shows both the retry feedback loop and the internal resource collapse path that make overloaded systems degrade rapidly rather than recover naturally."
4344
/>
@@ -61,7 +62,7 @@ Consider a system processing 100 RPS with 200ms latency — that's 20 requests i
6162
Here's a counterintuitive truth: throughput can _increase_ during overload while your system becomes effectively useless. The distinction is between throughput (work attempted) and goodput (work successfully completed).
6263

6364
<Table
64-
variant="vertical-column-delineation-table"
65+
variant="report-table"
6566
content={{
6667
figure: "Throughput can increase during overload while goodput collapses.",
6768
thead: { th: ["Metric", "Definition", "Normal Load", "Under Overload"] },
@@ -94,6 +95,8 @@ This is the key insight: if you'd simply rejected 1,000 of those 2,000 requests
9495

9596
Think of admission control like a nightclub bouncer. The bouncer's job isn't to throw people out after they're inside causing trouble — it's to decide at the door who gets in. If the club is at capacity, new arrivals wait outside. The people inside have a good experience.
9697

98+
<Newsletter />
99+
97100
Admission control works the same way: decide _upfront_ whether to accept work, rather than accepting everything and failing later. A request rejected at the door costs almost nothing. A request that gets halfway through your system before timing out has consumed database connections, CPU cycles, and memory — resources that could have served requests you _could_ complete.
98101

99102
Here's how that flow looks in practice:
@@ -113,7 +116,7 @@ It's better to reject 20% of requests immediately than to accept 100% and fail 4
113116
I've found four approaches cover most scenarios:
114117

115118
<List
116-
variant="check-icons-list"
119+
variant="card-grid-list"
117120
items={[
118121
{
119122
lead: "Rate limiting:",
@@ -134,6 +137,8 @@ I've found four approaches cover most scenarios:
134137
]}
135138
/>
136139

140+
Of these, latency-based admission gives you the tightest feedback loop. Here's how it works as Express middleware:
141+
137142
```typescript title="latency-admission-middleware.ts"
138143
// Express middleware for latency-based admission control
139144
import { Request, Response, NextFunction } from 'express';
@@ -225,16 +230,14 @@ Code: Priority-based routing reserves capacity for critical traffic.
225230
226231
The key insight is that critical traffic can _borrow_ capacity from lower tiers. If the anonymous quota is exhausted but the critical quota has room, anonymous requests are rejected while payments keep flowing.
227232
228-
<Newsletter />
229-
230233
## Load Shedding and Graceful Degradation
231234
232235
### Choosing What to Shed
233236
234237
Load shedding is the deliberate dropping of work to preserve system stability. It sounds brutal, but the alternative is worse. When you're drowning, you throw cargo overboard to keep the ship afloat.
235238
236239
<Table
237-
variant="vertical-column-delineation-table"
240+
variant="grid-and-accent-header-table"
238241
content={{
239242
figure: "Load shedding strategies and their tradeoffs.",
240243
thead: { th: ["Strategy", "When to Use", "Tradeoff"] },

0 commit comments

Comments
 (0)