What it is
A bottleneck is the resource that limits a system's throughput: the stage with the least capacity relative to the load it receives. Every request-serving system has one at any given load. Bottleneck identification is the practice of finding it from measurements, rather than from intuition or from whichever dashboard is reddest.
Why it exists
Effort spent on a non-bottleneck stage changes nothing: more app servers in front of a saturated database add cost, not throughput, and can make latency worse. Meanwhile the symptoms of a bottleneck appear everywhere upstream of it, because callers wait for it. Without a method, teams scale the tier that looks busiest, which is often the wrong one.
How it works
Capacities per stage. For each stage estimate the maximum rate: concurrency ÷ time held per request. An app instance with 8 workers holding each for 69 ms does about 116 req/s; a database running 4 queries at 25 ms does about 160 queries/s. If every request visits each stage once, the smallest number is the system's ceiling. If some stages are visited several times per request (N queries per page) or only by some requests (cache misses), multiply by the visit ratio.
Symptoms of saturation. When the offered load exceeds the bottleneck's capacity:
- throughput plateaus at the bottleneck's capacity, below the offered load;
- the bottleneck runs at ~100% utilisation and has a queue in front of it (waiting threads, a full connection pool, consumer lag, run-queue length);
- latency rises for every request that passes through it.
Propagation upstream. If callers block while waiting (a thread per request, a synchronous call), the waiting holds their resources too. Upstream stages then show high utilisation, full queues and often the errors (rejections, timeouts), even though their own work is light. The lesson shows exactly this: the app tier rejects every failed request while the database is the cause. Rule of thumb: the bottleneck is the deepest stage that is saturated with its own work and has requests waiting for it. Measuring where request time goes (traces with spans per dependency, pool wait time, queue wait time) confirms it.
Fixing it. Three options: make each request cheaper at the bottleneck (an index, fewer queries, smaller payloads), give the bottleneck more parallel capacity (bigger instance, more replicas or shards, more consumers), or send it less work (caching, batching, moving work off the critical path). Then re-measure: the next-smallest stage is now the limit, and the right fix there may be the one that was wrong a minute ago.
Hidden bottlenecks. Averages over a tier conceal a single slow member: a degraded host, a hot shard, a hot key, one expensive endpoint. Per-instance and per-endpoint breakdowns and tail latency (P99) reveal them.
The USE method. For each resource (CPU, memory, disk, network, thread pools, connection pools, locks, queues), check Utilisation, Saturation (queued work) and Errors. It is a checklist that keeps you from stopping at the first red graph. For request-level services, the complementary RED method tracks Rate, Errors and Duration per service.
When to use it
- When throughput stops growing with load, or latency rises with load.
- Before scaling anything: confirm the tier you are about to scale is the bottleneck.
- During incidents, to decide which mitigation will actually relieve pressure.
- In capacity planning, to know which tier binds first as traffic grows.
When not to
- When the problem is not throughput: a functional bug, a misconfiguration or a single slow request path at low load needs debugging or profiling, not capacity analysis.
- At very low utilisation everywhere, latency is dominated by the work itself (network hops, query plans), not by a saturated stage; optimise the critical path instead.
Trade-offs
| Fix | You gain | You pay |
|---|---|---|
| Make the bottleneck's work cheaper (indexes, query tuning) | Capacity and latency, often for free | Engineering time; may need schema or code changes |
| Scale the bottleneck up or out | Quick capacity | Cost; stateful tiers (databases) scale out with difficulty |
| Cache in front of the bottleneck | Large reduction in load for read-heavy traffic | Staleness, invalidation, a new failure mode |
| Move work off the critical path (queues, async) | Lower latency, levelled load | Eventual consistency, operational complexity |
| Limit load (rate limits, shedding) | Protects the bottleneck | Some requests are refused |
Alternatives
- Profiling finds bottlenecks inside one process (a hot function, lock contention, GC).
- Distributed tracing shows where time goes across services for individual requests, which is often faster than reasoning from utilisation alone.
- Load testing with stepwise increasing load finds the knee and the first stage to saturate before production does.
Failure modes
- Scaling the busiest-looking tier: the busy tier was blocked on a downstream one.
- Trusting error sources: errors are raised where a queue overflows or a timeout fires, which is often upstream of the bottleneck.
- Fleet averages: one saturated instance or shard hides behind a reassuring average.
- Fixing once: after the fix, the next bottleneck appears, sometimes in a tier nobody was watching.
- Making it worse: more callers against a saturated database means longer waits, more timeouts and retries, and possibly lower throughput through contention.
In production
Instrument queue and wait times, not just utilisation: thread pool queue length, connection pool wait time, consumer lag, CPU run queue. Use traces with spans for each dependency. Dashboards should show per-instance and per-shard breakdowns and P99, not only fleet averages. Write down each tier's measured capacity next to its current peak, so the binding tier is visible before it binds. Load test after major changes, because the bottleneck may move.
Common misconceptions
- "The component throwing errors is the problem." It is the one whose queue or timeout overflowed first, often upstream of the cause.
- "High utilisation means bottleneck." Blocked threads count as busy. Look for saturation with its own work and a queue in front.
- "Adding servers always adds throughput." Only at the bottleneck.
- "Once fixed, it stays fixed." Fixing a bottleneck promotes the next one.
Interview angle
In a design interview, state where you expect the first bottleneck at the target load (usually the database or a shared dependency), with numbers, and how you would confirm it (utilisation and saturation per tier, traces). When asked "what if traffic grows 10×?", walk the stages in order: which saturates first, what you do about it, and which one is next. Mentioning that blocked callers make upstream tiers look saturated shows real operational experience.
Model assumptions
The simulation is a simplified model, not a benchmark. Each app instance has 8 workers, 40 ms of its own work per request (lognormal, cv 0.4) and queues up to 30 requests before rejecting; a worker stays held while it waits for the database (blocking calls). The database runs 4 queries at once at 25 ms per read (10 ms after the index) and 40 ms per write, cv 0.4, and fails a query that waits more than 400 ms for a connection. Arrivals are Poisson; the balancer uses round robin; network hops take 1–10 ms. The slow instance is modelled as 3× longer service time. Utilisation is the busy fraction of workers or connections, not CPU. Numbers are illustrative.