Skip to content
hostcomplex

What Is a Load Balancer

Maarten Soetens 3 min read

How a Load Balancer Distributes Traffic

A load balancer is a service that receives incoming network traffic and forwards each request to one of several backend servers. Users see a single address, while the work is shared among the servers behind it.

Without a load balancer, users would need to reach one specific machine, and the site would fail if that machine failed. The load balancer hides this structure. When a server is removed for maintenance or added during a busy period, only the balancer's list of backends changes. The public address stays the same.

The rule the balancer uses to pick a server is called a balancing algorithm, described in load balancing algorithms.

Health Checks, Sticky Sessions and TLS Termination

Health checks are regular tests that the balancer runs against each backend, such as requesting a page and expecting a success response. A server that fails the check is removed from rotation until it recovers, so users are not sent to a broken machine.

Sticky sessions, also called session affinity, send all requests from one user to the same server. This helps when a server keeps login or cart data in its own memory. Stateless designs avoid the need for it, because any server can answer any request.

TLS termination means the load balancer handles the encrypted connection with the user. TLS (Transport Layer Security) is the protocol behind HTTPS. Decrypting at one point centralises certificate management, but traffic between the balancer and the backends must then be protected by other means, such as a private network or a second layer of encryption.

Why Load Balancers Support Availability and Growth

A load balancer removes a single point of failure only when it is itself redundant. Cloud providers usually run load balancers as managed services spread across several availability zones, which are separate data centres within one region. A single facility failing then does not take the entry point down.

Load balancers also make growth simpler. Adding a server behind the balancer increases capacity without changing how users reach the site. Where in the network the balancer works, explained in layer 4 vs layer 7 load balancing, affects how much it can see and route.

Frequently asked questions

Does every website need a load balancer?

No. A small site that runs well on one server does not need one. A load balancer becomes useful when you run two or more servers, need to survive a server failure, or expect traffic to grow beyond what one machine can handle.

Is a load balancer the same as a reverse proxy?

They overlap. A reverse proxy sits in front of servers and forwards requests on their behalf. Many load balancers are reverse proxies, but the defining job of a load balancer is spreading traffic across several backends. A reverse proxy may also be used for other purposes, such as hiding server addresses.

Does a load balancer slow down requests?

It adds a small amount of processing time to each request, usually too little for users to notice. Its overall effect is usually positive, because no single server is overloaded. Poor configuration, such as aggressive sticky sessions or incorrect health checks, can cause uneven load and should be reviewed.

  • Two-Factor Authentication

    Two factor authentication hosting adds a second check to control panel, domain and CMS logins. Learn which methods are strongest and why 2FA helps.

  • What Is an A Record?

    What is an A record? Learn how this DNS record maps a hostname to an IPv4 address, why domains use several A records and the root and www pattern.

  • Billing and Automation Platforms

    What is WHMCS? Learn how this commercial billing and automation platform helps hosts sell plans, collect payments and create accounts automatically.