What is a bottleneck in system design? How to find and fix one

A system is only as fast as its slowest step. Here is what a bottleneck is, how to spot one with simple measurements, and why fixing it usually moves the problem somewhere else.

A wide glass bottle full of small balls labelled requests. They squeeze through the narrow neck one or two at a time, so a pile builds up inside the bottle while only a thin stream comes out of the top.
Fig. 1 — However wide the bottle is, things only come out as fast as the neck lets them.

Picture a busy chai stall with three people working. One takes orders, one makes chai, one hands it over. The order-taker can handle 60 customers an hour and so can the person at the counter. But the chai-maker can only make 20 cups an hour. How many customers does the stall serve in an hour?

Twenty. Not sixty, not the average of the three. The chai-maker is the bottleneck, and the whole stall moves at their speed. A queue forms in front of them while the other two wait around.

Software systems behave exactly the same way. This guide explains what a bottleneck is, how to find one, and how engineers deal with it.

What is a bottleneck?

A bottleneck is the part of a system that limits how much work the whole system can do. The name comes from a bottle: no matter how wide the bottle is, liquid only pours out as fast as the narrow neck allows.

In a computer system, work flows through many steps. A web request might pass through a load balancer, an app server, a cache, a database and maybe another service’s API. Each step has a limit on how many requests it can handle per second. The step with the lowest limit decides the speed of the whole path.

A row of four boxes joined by arrows: load balancer handles 5,000 requests per second, app servers 2,000, database 400, and the response step 3,000. The database box is highlighted in red and a pile of waiting requests sits in front of it. Below, a bar labelled whole system shows 400 requests per second, matching the database.
Illustrative numbers. Every step is fast except one, and the whole system runs at that one step's speed.

Why the slowest step wins

When requests arrive faster than the bottleneck can handle them, two things happen:

  1. A queue builds up in front of it. Requests wait their turn, so each one takes longer. Users feel this as latency: the page gets slow.
  2. Everything before it is wasted effort. The app servers in the picture could handle 2,000 requests a second, but they spend most of their time waiting on the database.

If the arrivals keep coming faster than the bottleneck can drain them, the queue keeps growing until something gives up: requests time out, memory runs out, or the database falls over.

Common bottlenecks

Most systems hit one of a handful of limits. In rough order of how often you’ll meet them:

Bottleneck What it looks like
The database Slow queries, too many connections, one table everyone writes to
CPU Servers busy at close to 100%, work piling up
Memory Servers swapping to disk or crashing when they run out
Disk I/O Reading or writing files much slower than the rest of the system
Network Large responses, many round trips between services, a slow link between regions
A shared lock Many requests waiting for the same row, file or counter
An outside service A payment or SMS provider that only allows so many calls per second
A single thread One worker processing a queue that dozens of producers fill

The database tops the list in most web apps because it is the one part that is hard to copy: you can add app servers easily, but every one of them still talks to the same database.

How to find the bottleneck

Guessing is a common mistake. Engineers are often sure the problem is “the code” when it is really one slow database query. Measure before you fix. Three simple signals point to the bottleneck:

  • Utilisation. Which resource is close to full? A database at 95% CPU while app servers sit at 20% is a strong hint.
  • Queues. Where is work waiting? A growing message backlog, a full connection pool or many threads blocked on a lock all show where things pile up.
  • Time spent. Where does each request spend its time? Distributed tracing (covered in our guide to observability) shows a timeline of one request across every service, so the slow step stands out.

How to fix a bottleneck

Once you know where it is, the fixes fall into a few families:

  • Do less work there. Add an index so a query reads 10 rows instead of 10 million. Cache results so the database isn’t asked the same question again and again.
  • Add more of it. Run more copies (scale out) or give it a bigger machine (scale up). See vertical vs horizontal scaling.
  • Split the work. Send reads to replicas (replication) or spread data across several databases (sharding).
  • Stop waiting for it. Put slow work in a message queue and do it in the background, so the user doesn’t wait.
  • Protect it. If you can’t make it faster yet, limit how much reaches it with rate limiting and load shedding, so it slows down instead of falling over.

Fixing one bottleneck reveals the next

Here is the part that surprises people. In the picture above, say you fix the database so it handles 2,500 requests a second. Is the system now 2,500 fast? No. The app servers top out at 2,000, so they are now the bottleneck.

There is always a slowest step. Performance work is a loop: measure, find the bottleneck, fix it, measure again, and stop when the system is fast enough for what you need. “Fast enough” matters, and it comes from your non-functional requirements. Without a target, you could keep tuning forever.

Common misconceptions

“Faster code fixes slowness.” Only if the code is the bottleneck. Making the app twice as fast does nothing if every request spends 90% of its time waiting on the database.

“More servers always help.” More servers help only when the servers are the limit. If they all share one database, more servers can make things worse by opening even more connections to it.

“A bottleneck is a bug.” Not always. Every system has a slowest part. It only becomes a problem when traffic grows past what that part can handle.

Key takeaways

  • A bottleneck is the step that limits how much the whole system can do.
  • The system runs at the speed of its slowest step, and a queue forms in front of it.
  • Find it by measuring utilisation, queues and time spent, not by guessing.
  • Fix it by doing less work there, adding more of it, splitting the work, moving it to the background or protecting it.
  • Fixing one bottleneck reveals the next. Stop when you meet your target.

Frequently asked questions

What is a bottleneck in simple words?

A bottleneck is the slowest part of a process, the one that holds everything else back. Like the narrow neck of a bottle, it decides how fast things can flow through.

What is the most common bottleneck in web applications?

The database is the most common one, because many app servers share it and it is harder to copy than a stateless server. Slow queries, missing indexes and too many connections are frequent causes.

How do you identify a performance bottleneck?

Measure. Look at which resource is nearly full (CPU, memory, disk, connections), where work is queuing up, and which step takes the most time in a traced request. The part that is full and has work waiting in front of it is usually the bottleneck.

Can a system have more than one bottleneck?

At any moment, one step usually limits throughput the most. But different kinds of requests can have different bottlenecks, and as soon as you fix one, another step becomes the new limit.

Is a bottleneck the same as a single point of failure?

No. A bottleneck limits speed. A single point of failure is a part whose failure brings the whole system down. One part can be both, like a lone database, but they are different problems. See failover for the second one.

Comments

LEAVE A COMMENT
No sign-up. Comments appear after a quick review.