Load balancers
Spreads incoming traffic across healthy servers.
4 technologies on this page ↓How it works
A load balancer gives a service one stable address and forwards each request or connection to one of several backends. It runs health checks and stops sending traffic to failed instances, terminates TLS, and lets you add or remove servers without clients noticing. It picks a backend with an algorithm such as round robin, least connections or hashing. Layer 4 balancers forward TCP and UDP connections; layer 7 balancers understand HTTP and can route by host name or path.
The host at a busy restaurant, seating each new party with a waiter who’s free and skipping the section that’s closed.
Reach for it when
- Running more than one copy of any service
- Zero-downtime deploys: drain old instances, add new ones
- Terminating TLS in one place
Think twice when
- A single instance with no redundancy; it adds cost and little else
- Cross-region failover on its own; that needs DNS or a global balancer
A real example
Three API servers sit behind an Application Load Balancer. When server 2 fails its /health check twice in a row, the balancer stops routing to it, and users only ever see the other two answer.
More on load balancers
Narrower ideas that build on this one.
Technologies
Specific products, and what each does differently.
AWS Application Load BalancerAWSAWS’s managed layer-7 load balancer: routes HTTP requests by host, path or header to EC2, containers, IPs or Lambda. AWS Application Load Balancer | Managed service on AWS | Amazon Web Services | Proprietary | 2026-10-05 |
| Commercial product | Cloudflare, Inc. | Proprietary | 2026-10-12 | |
| Open source | F5, Inc. | BSD 2-Clause | 2026-10-05 | |
| Open source | Envoy project (CNCF), started at Lyft | Apache 2.0 | 2026-10-06 |
What each provider calls it
- AWS
- Elastic Load Balancing (ALB, NLB)
- Google Cloud
- Cloud Load Balancing
- Azure
- Load Balancer, Application Gateway
- Open source & others
- NGINX, HAProxy, Envoy
See it in a real stack
Architectures that use load balancers
In code · nginx
upstream api {
server 10.0.1.11:8080;
server 10.0.1.12:8080;
server 10.0.1.13:8080;
}
server {
listen 443 ssl;
location / { proxy_pass http://api; } # round robin by default
}Often confused with
Where it came from1996–2026
When early websites outgrew one machine, the first trick was round-robin DNS: publish several server addresses under one name and rotate their order. It spread load, but DNS had no idea whether a server was alive. If one failed, the DNS kept handing out its address, and caches meant clients kept trying it.
The fix was a box in front of the servers. Cisco’s LocalDirector was conceived in late 1995, when Netscape’s webmaster described customers whose round-robin DNS left some servers swamped and others idle. It reached its first customers in 1996. Such appliances gave a site one virtual address and mapped each connection to one of the servers behind it. Software caught up: the Linux Virtual Server project started in 1998, Willy Tarreau began writing HAProxy in 2000, and nginx’s first public release followed in 2004.
Large operators then moved load balancing back onto ordinary machines. Google has run Maglev, a load balancer built from commodity Linux servers, since 2008. In 2009 AWS made load balancing a managed service with Elastic Load Balancing, and its layer-7 Application Load Balancer arrived in 2016.
Why it’s built this way
- One virtual address in front of many servers
- Clients only ever see the balancer’s address, so servers can be added, removed or patched behind it without anyone updating DNS or client configuration.
- Health checks decide where traffic goes
- Round-robin DNS kept sending users to dead servers. A balancer that probes each backend stops using a failed one after a few missed checks.
- Layer 4 for speed, layer 7 for smarts
- Forwarding TCP connections without reading them is fast and works for any protocol. Reading HTTP costs more CPU but allows routing by host or path, TLS termination and retries.
- Software on commodity servers instead of appliances
- Google built Maglev this way because it needs no special rack deployment and capacity grows by adding servers. Cloud load balancers work on the same principle.
Timeline
- 1996
Cisco LocalDirector ships, an early dedicated load-balancing appliance
- 1998
Wensong Zhang starts the Linux Virtual Server project
- 2000
Willy Tarreau starts writing HAProxy
- 2008
Google’s Maglev software load balancer starts serving production traffic
- 2009
AWS launches Elastic Load Balancing as a managed service
- 2016
AWS adds the layer-7 Application Load Balancer; Google publishes the Maglev paper
- 2026
Kubernetes retires the community ingress-nginx controller in March, pointing users to Gateway API
- RFC 1794: DNS Support for Load Balancing (1995)
- Wikipedia: Round-robin DNS
- John Mayes: The LocalDirector (History of the PIX Firewall) · archived copy, original
- Linux Virtual Server project news (1998 onward)
- Wensong Zhang: Linux Virtual Server for Scalable Network Services (OLS 2000)
- HAProxy CHANGELOG (first write, 26 Nov 2000)
- nginx on GitHub: nginx 0.1.0, the first public version (Oct 2004)
- Maglev: A Fast and Reliable Software Network Load Balancer (NSDI 2016)
- AWS What’s New: Monitoring, Auto Scaling and Elastic Load Balancing for Amazon EC2 (2009)
- AWS News Blog: New – AWS Application Load Balancer (Aug 2016)
- Kubernetes blog: Ingress NGINX statement (Jan 2026)
- kubernetes/ingress-nginx on GitHub (archived March 2026)
Sources11
- ELB docs: What is Elastic Load Balancing?
- ALB docs: Health checks for target groups (defaults: every 30 s, 2 failures)
- NLB docs: What is a Network Load Balancer? (layer 4, TCP and UDP)
- ALB docs: Condition types for listener rules (host and path routing)
- Google Cloud docs: Cloud Load Balancing overview
- Microsoft Learn: What is Azure Load Balancer?
- Microsoft Learn: What is Azure Application Gateway?
- nginx docs: Using nginx as HTTP load balancer (round-robin by default)
- HAProxy docs: Starter guide, introduction to load balancing
- Envoy docs: Load balancing overview
- Global Accelerator docs: How it works (balancing across Regions)