What is a load balancer and when does your website need one?

Published on 2026-10-20 by frfrand

Load balancer explained with examples: how it distributes requests between servers, difference between load balancing and failover, health checks and sessions.

What is a load balancer and when does your website need one?

Short answer: A load balancer is a component that receives connections or requests and distributes them among several servers capable of handling them. It is used to share workload, keep services available, and avoid depending on a single application instance.

Imagine a restaurant with only one person taking orders. Even if there are ten cooks, if no one distributes the tickets, service becomes chaotic. A load balancer plays a similar role: it decides where to send each new request.

How does a load balancer work?

Suppose you have three servers with the same application. Visitors enter tienda.ejemplo.com and arrive at a common point. That point knows the available instances and chooses which one to send each request or connection to.

The choice depends on the technology and the algorithm. For example, round robin distributes requests in rotation; least connections may prefer the server with fewer active connections.

This does not mean each visitor always ends up on the same server. The same person can make several requests and receive responses from different instances.

What is a health check?

A load balancer may need to know if an instance is actually ready to handle traffic. A health check is a health check: a request, connection, or other signal used to decide if a server remains available.

But checking that a port responds does not guarantee that the entire business works. An application can serve the homepage while its database is down. It is advisable to define checks that represent the actual capacity to process requests.

If an instance fails, the load balancer can stop sending traffic to it until it recovers, according to its rules.

Does load balancing mean high availability?

Not always. If you have three servers but a single load balancer without redundancy, that component can become a single point of failure.

There can also be a shared database that, if it goes down, renders all instances unusable. Distributing requests is only part of availability.

Failover means switching to an alternative when a component fails. Load balancing means distributing traffic among available options. They can work together, but they are different concepts.

What about user sessions?

Imagine that a client logs in to server A and their next request arrives at server B. If the session state exists only in the memory of the first one, the second may not know about it.

That is why distributed applications often use shared sessions, tokens with proper validation, or other architectures that allow handling requests from multiple instances.

Some load balancers offer affinity or sticky sessions, but that does not replace state planning. If the chosen server stops working, you still need a strategy.

What is the difference between L4 and L7 load balancing?

A layer 4 load balancer works mainly with transport data, such as TCP or UDP connections and addresses/ports.

A layer 7 load balancer can interpret application-level requests, such as HTTP, and make decisions based on routes, headers, or hostnames.

It is not that layer 7 is universally better. It allows more specific decisions, but it implies other considerations regarding complexity, performance, and encryption handling.

Do I need one for my first website?

Probably not. A small application can work perfectly on a single VPS. Introducing a load balancer, duplicate servers, and a shared database means more work, more components, and more possible points of failure.

It may start to make sense when you really need additional capacity, zero-downtime updates, or instance fault tolerance. First measure traffic, resources, and response times.

What about Nginx?

Nginx can act as a web server and as a connection or request load balancer, depending on how it is configured. It can distribute traffic among multiple backends and apply different policies.

That does not mean that Nginx automatically makes copies of the application or keeps databases synchronized. The load balancer only knows the alternatives you configured and the corresponding rules.

Where does ArduMaker come in?

ArduMaker does not offer, as of November 2026, a managed load balancer as a product: each published domain points to a VPS. If you want to distribute load, you set up the load balancer yourself, for example with nginx inside a VPS that receives the domain and distributes traffic to several instances of your application.

A detail that changes the design: for a VPS to use a service from another VPS in the same location, the intended path is an SSH tunnel between VPSs, which leaves the other port available on localhost of the one initiating the tunnel, without exposing anything to the Internet. And, as in any architecture, you must define how to detect failures and what happens if the load balancer itself becomes inaccessible.

In summary: a load balancer distributes requests; an available architecture must also resolve sessions, data, monitoring, and single points of failure.

Frequently asked questions

Which load balancing algorithm is recommended in nginx?

By default, nginx uses round robin, which works well if requests are similar. least_conn sends each request to the backend with the fewest active connections and helps when some take much longer than others. ip_hash always sends the same client to the same backend, a simple way to achieve session affinity.

Is a CDN a load balancer?

Not exactly. A CDN stores copies of content on servers close to visitors and reduces the load on the origin. Many include origin load balancing features, but their main goal is to bring content closer and cache it.

Sources: HTTP load balancing in Nginx · Nginx: methods and configuration.

What is a load balancer and when does your website need one?
  • load balancer
  • servidores
  • alta disponibilidad
  • Nginx

Keep reading

All articles · VPS plans