What is a Load Balancer?
A load balancer is hardware or software that distributes incoming traffic across multiple servers so no single server is overwhelmed by requests. Many operate as a reverse proxy, receiving each request and forwarding it to a backend server. Health checks remove a failed server after detection, which reduces downtime as long as the remaining servers can absorb its traffic.
More About Load Balancers
A load balancer sits in front of your servers and routes each incoming request to the server best able to handle it. If your website runs on more than one server, such as several cloud-hosted instances or multiple Virtual Private Server (VPS) instances, the load balancer decides which machine answers each visitor.
Load balancers are essential once a website runs on more than one server, which is how most high-traffic sites handle their traffic. Many load balancers act as a reverse proxy: they accept incoming requests and forward them to the web servers behind them. If one server fails a health check, the load balancer stops routing traffic to it, which is how a multi-server site keeps running when one machine dies. That also lets you take a server down for maintenance or upgrades without hurting your uptime.
How a load balancer works
Every request follows the same path. A visitor’s browser connects to the load balancer’s address, the balancer picks a server from the pool, forwards the request, and relays the response back to the visitor. The visitor never learns how many servers sit behind that one address, or which of them answered.

The rule for picking a server is called a load balancing algorithm. AWS’s load balancing overview splits them into static algorithms, which follow fixed rules, and dynamic ones, which check each server’s current state. Three cover most setups:
- Round robin: each server gets the next request in turn, first to last and back again.
- IP hash: the visitor’s IP address is converted into a number that maps to one server, so the same visitor always lands in the same place.
- Least connections: the request goes to whichever server has the fewest active connections right now.
Health checks keep the rotation honest. The balancer regularly tests that each server still responds and pulls a failed one out of the pool until it recovers. That shortens an outage rather than preventing every error: requests that arrive between the crash and the next check can still fail, and the remaining servers need enough spare capacity to absorb the redirected traffic. Availability is the benefit AWS lists first, ahead of scalability, security, and performance.
Load balancer vs. reverse proxy
The two terms overlap, but they aren’t synonyms. A reverse proxy is a server that sits in front of your web servers and accepts requests on their behalf. It’s useful even with a single backend: it can cache responses, handle TLS encryption so the web server doesn’t have to, and keep the backend’s address hidden, since visitors only ever connect to the proxy. Many Layer 7 load balancers, the kind described in the next section, work as reverse proxies. But the concepts aren’t identical: a reverse proxy can serve a single server, and a load balancer doesn’t need to inspect or proxy HTTP requests to do its job.
Layer 4 balancers forward traffic based on IP addresses and ports without ever reading the HTTP request. And in DNS round robin, the authoritative name server answers each lookup with a different server’s IP address in turn, distributing visitors with no proxy in the path at all.
Types of load balancers
Load balancers differ on two axes: what they run on, and how much of each request they read. By form, you have 3 options:
- Hardware appliances: dedicated physical devices from a vendor, bought up front as a capital purchase.
- Software: programs you install and run on your own servers, often free and open source.
- Cloud services: your provider operates the load balancer for you as a managed service and bills per use; you set the rules and never touch the machines.
By depth, the split is Layer 4 versus Layer 7, named for layers of the OSI networking model:
- Layer 4 balancers route on the IP addresses and ports in a packet’s header without reading its contents. Fast, simple, and blind to what the request actually asks for.
- Layer 7 balancers read the HTTP request itself, so they can route by URL or cookie, handle encryption, and pin a visitor to one server (sticky sessions) so a login or shopping cart doesn’t vanish when requests hop between machines. F5’s glossary notes the extra inspection rarely slows a modern server.
When you need a load balancer
If your site runs on one server, you don’t need one. Typical web hosting or a single VPS puts everything on one machine, so there’s nothing to balance. The need starts when an application outgrows a single server and you run 2 or more of them behind one address.
Some managed hosting services include load balancing, but check the plan’s feature list rather than assuming it. Failover protection is a related but different safeguard: DreamPress, DreamHost’s managed WordPress hosting, includes it on every plan, keeping an updated copy of your site on standby and switching over to it automatically if anything goes wrong. That’s protection against failure, not load balancing: the standby copy waits rather than sharing the live traffic.
Check the simpler options before adding servers. A CDN absorbs traffic spikes by caching your static files close to visitors, though its core job is caching, not spreading requests across your servers. And if the real problem is a surge on a single server, scaling that server up is usually simpler than adding a second one. Our guide to scaling a VPS for traffic surges shows how.
Frequently Asked Questions
What are examples of load balancers?
NGINX and HAProxy are widely used open-source software load balancers: NGINX is distributed under the 2-clause BSD license, and HAProxy is free and ships with most mainstream Linux distributions. Cloud platforms like AWS offer load balancing as a managed service, so you never install anything.
Is a load balancer a single point of failure?
It can be. If the only load balancer dies, the whole site goes down even though every server behind it is healthy. That's why production setups run a redundant pair, with a standby balancer that takes over automatically when the active one fails.
Does a CDN do load balancing?
Not necessarily. A CDN's core job is caching: it serves copies of your content from edge locations near each visitor, while a load balancer distributes requests among your own servers. Some CDN providers do offer origin load balancing as a separate or bundled feature, so check your plan.