Load shedding is the deliberate rejection or dropping of part of the incoming requests when a server or service is overloaded, so that the remaining requests can still be processed within acceptable latency. In the reliability of servers, it is a defensive mechanism that trades partial, controlled failure for the alternative of total collapse.
The idea rests on a simple observation: a system pushed beyond its capacity does not merely slow down, it often stops doing useful work because queues grow, timeouts expire and clients retry. By refusing excess work early and cheaply, typically with an HTTP 503 or 429 response, load shedding keeps throughput close to capacity and protects the service for most users.
Why overloaded servers need load shedding
Without load shedding, an overloaded server accepts every request and places it in a queue. As the queue grows, every request waits longer, including those that will eventually time out on the client side. The server then spends CPU time on work whose result nobody will receive, which is known as goodput collapse: raw throughput stays high while useful throughput falls toward zero.
Client behavior makes this worse. Timed-out clients retry automatically, multiplying the incoming load exactly when the server is weakest, which can produce a retry storm or a cascading failure across dependent services. Load shedding breaks this loop by failing fast: a rejected request costs microseconds instead of seconds of wasted processing.
The table below contrasts the behavior of a server under overload with and without load shedding.
| Aspect | Without load shedding | With load shedding |
|---|---|---|
| Latency of accepted requests | Grows without bound | Stays near normal |
| Useful throughput | Falls sharply | Stays close to capacity |
| Memory usage | Rises with queue length | Bounded by queue limits |
| Client experience | Timeouts for nearly everyone | Fast errors for some, success for most |
| Recovery after the spike | Slow, backlog must drain | Almost immediate |
How load shedding decides what to reject
A load shedding mechanism needs an overload signal and a rejection policy. The signal tells the server that it has reached its limit; the policy decides which requests to drop when that happens.
Useful signals include the number of concurrent requests in flight, queue length, the time a request has already spent waiting, CPU utilization and memory pressure. Queue waiting time is often the most reliable indicator, because it directly reflects whether a request can still be served before the client gives up.
| Strategy | How it works | Best suited for |
|---|---|---|
| Concurrency limit | Rejects requests above a fixed number in flight | Services with stable request costs |
| Queue timeout | Drops requests that waited longer than a threshold | Workloads with strict client deadlines |
| Priority-based shedding | Drops low-priority traffic first | Mixed critical and background traffic |
| Adaptive limits | Adjusts the limit from observed latency | Variable workloads and dependencies |
| Probabilistic dropping | Rejects a growing share as load rises | Smooth degradation at large scale |
Prioritization is what turns load shedding from a blunt tool into a precise one. A typical scheme keeps checkout, login and health checks at the highest priority and sheds analytics beacons, prefetch requests, crawlers and batch jobs first, so the most valuable work survives the overload.
Load shedding compared with related reliability techniques
Load shedding is one of several overload protection techniques, and it is often confused with rate limiting and circuit breaking. They differ in what triggers them and whom they protect.
| Technique | Trigger | Main purpose |
|---|---|---|
| Load shedding | Current server overload | Protect the server from collapse |
| Rate limiting | A client exceeds its quota | Enforce fair use per client |
| Circuit breaker | A dependency keeps failing | Stop calling an unhealthy service |
| Backpressure | Downstream cannot keep up | Slow producers instead of dropping |
| Autoscaling | Sustained high utilization | Add capacity over minutes |
| Graceful degradation | Overload or partial failure | Serve reduced features |
These techniques complement each other. Autoscaling cannot react within seconds, so load shedding protects the service while new instances boot. Redundancy, failover and N+1 capacity reduce how often shedding is needed, but no amount of spare capacity removes the need for a defined behavior when demand exceeds supply.
Where load shedding is implemented
Load shedding can be applied at several layers of the stack, and mature systems usually combine more than one. The closer to the edge a request is rejected, the less capacity it consumes.
- Load balancers and reverse proxies can cap connections per backend and return 503 when all backends are saturated.
- Application servers can limit worker pools and request queues, rejecting new work when they are full.
- Service frameworks and meshes often provide adaptive concurrency limits that react to latency changes.
- Databases enforce connection limits and statement timeouts, which act as a last line of shedding.
A rejected response should be cheap to produce and informative. Returning 503 with a Retry-After header tells well-behaved clients when to try again, and clients should combine it with exponential backoff and jitter so that retries do not arrive in synchronized waves.
Common mistakes when applying load shedding
The most frequent mistake is setting thresholds without load testing. A limit set too low wastes capacity and rejects users unnecessarily, while a limit set too high activates only after the server is already collapsing.
- Shedding too late, after expensive work such as authentication or database queries has already been done.
- Treating all traffic equally, so that critical transactions are dropped as often as background requests.
- Ignoring retries, which lets rejected clients return immediately and amplify the overload.
- Missing monitoring, so that shed requests are not counted and the team does not see the overload at all.
Shed requests should be tracked as a dedicated metric and alerted on, because a rising rejection rate is an early signal that capacity planning or redundancy needs attention. Teams commonly verify their shedding behavior with load tests and chaos engineering exercises before relying on it in production.
The simple explanation
Load shedding is what a server does when too many people ask for something at once. Instead of trying to serve everyone and failing everyone, it politely turns some requests away so it can serve the rest properly.
Think of a popular restaurant on a busy night. If it seats every guest who walks in, the kitchen falls behind and nobody gets a meal on time. A good host stops seating new guests when the kitchen is full. Some people wait or come back later, but those inside get their food.
How it is used in practice
A ticketing platform expects heavy demand when a popular concert goes on sale. Load tests show that each application server handles about 400 concurrent requests before response times rise sharply, so the team sets a concurrency limit of 350 requests per server and configures the reverse proxy to return 503 with a Retry-After header when the limit is reached.
Traffic is also split into priority classes: payment and checkout calls receive the highest priority, seat-map browsing the middle one, and recommendation widgets and analytics the lowest. When sales open, incoming traffic reaches about three times the planned capacity. The servers shed most analytics and recommendation calls and part of the browsing traffic, while checkout latency stays under 300 ms and no server crashes. Autoscaling adds capacity over the next ten minutes, and the rejection rate falls back to zero.