What Is Load Balancing? How Sites Survive Millions of Visitors
📷 panumas nikhomkhai · Pexels✦ Key takeaways
- A load balancer distributes requests across several servers to avoid overloading one.
- It boosts performance and reliability: if a server fails, requests go to the others.
- There are different distribution algorithms like round-robin and least-connections.
- It's a cornerstone of any system that needs to scale horizontally.
Load balancing is distributing incoming visitor requests across a group of servers instead of sending them all to one. Picture a busy restaurant with one host who spreads customers across several waiters instead of serving them all himself — that's exactly the role of a load balancer sitting between visitors and servers.
Why do we need it? Because any server, however powerful, has a maximum number of requests it can handle per second. When traffic exceeds that limit, the site slows down or crashes. The solution is to run several identical servers and place a balancer in front of them that distributes the load intelligently, so the system handles many times what a single server could.
🌐 Download Time
How long any file takes to download at your speed — instantly.
The second benefit is just as important: reliability. If one server fails, the balancer notices and stops sending requests to it, routing visitors to the healthy servers instead. The result is that the site keeps working despite a partial failure — this is called failover.
| Algorithm | How it distributes requests |
|---|---|
| Round Robin | Evenly, in turn, across servers |
| Least Connections | To the currently least-busy server |
| Weighted | Stronger servers get a bigger share |
| Source (IP Hash) | The same visitor goes to the same server |
Choosing the algorithm depends on the application. Round Robin is the simplest and works when servers and requests are similar. Least Connections is better when request durations vary. And source-based is useful when a visitor needs to stay on the same server throughout their session (like a shopping cart). Many systems mix them as needed.
Load balancing is what makes horizontal scaling possible: instead of buying a bigger server (vertical scaling, which has a ceiling), you add more identical servers behind the balancer as demand grows. This is the model on which giant sites serving millions of simultaneous visitors are built without collapsing.
Bottom line: load balancing isn't a luxury but a necessity for any growing service. It combines two goals: higher performance by spreading the load, and greater reliability through failover — the secret behind how big sites withstand the crowds.
