Tech foundations

What is a load balancer?

In short

A load balancer is a reverse proxy that spreads incoming traffic across several servers, so that no single server is overloaded and the service keeps running if one server fails.

Instead of one server doing all the work, several identical servers share it. The load balancer receives every request and passes it to a server that is healthy and has capacity. If a server stops answering, it is left out until it recovers.

Mini course

3 short lessons, about 2 minutes in total

  1. Sharing the work
  2. How it chooses
  3. Why it matters for AI

Lesson 1

Sharing the work

One server can only answer so many requests at once. When traffic grows, you can buy a bigger server, or you can add more servers and share the work. The second way scales much further, but someone has to decide which server takes each request. That is the load balancer.

It sits in front of the servers, so visitors only ever see one address.

Lesson 2

How it chooses

The simplest rule takes turns: server 1, then 2, then 3. Smarter rules send the request to the server with the fewest active users, or the one closest to the visitor. The load balancer also checks every few seconds that each server is healthy and skips the ones that are not.

Many visitors
Load balancer
Server pool
Server 1
Server 2
Server 3
A load balancer spreads incoming requests over several servers so no single one gets overloaded

Tap a box to open that concept

Some apps need a visitor to stay on the same server, for example during checkout, and the load balancer can handle that too.

Lesson 3

Why it matters for AI

AI models are heavy to run, and each request can take seconds. Providers run the same model on many machines and balance requests over them. Inside a company, an AI gateway often does a similar job by spreading requests over several model providers or accounts.

  1. Customers find youHow customers and AI tools find the companySEOGEOGoogle AI Overviews
  2. AI in daily workTools staff and customers useChatbotAI copilotVoice AI
  3. Building blocksHow AI connects to data and systemsRAG (retrieval-augmented generation)AI agentMCP (Model Context Protocol)
  4. AI modelsThe models that understand and createLarge language model (LLM)Generative AIMachine learning
  5. DataCompany data, gathered and cleanedData warehouseETLData quality
  6. InfrastructureCloud, networks and systems underneathLoad balancerCloud computingDatabaseAPI key
Trust and rulesSecurity, law and control in every layerGDPR and AIEU AI ActAI guardrails
Where Load balancer sits in a company's AI setup

When an AI service says it is 'at capacity', it usually means all machines behind the balancer are busy.

An everyday example

On a big sale day, an online shop adds ten extra servers. The load balancer starts sending customers to them right away, and the shop stays up.

How companies use it

Companies use load balancers to keep websites, apps and AI services available during peaks, to update servers one at a time without downtime, and to grow by adding servers.

Frequently asked questions

Is a load balancer a proxy?

A load balancer is a kind of reverse proxy whose main job is to share work between servers.

Do AI services use load balancers?

AI services use load balancers. Requests to AI models are spread over many machines with AI chips, often across several data centers.

Do I need one for a small website?

A small website rarely needs its own load balancer. Cloud hosts and CDNs balance load behind the scenes.

In depth: Load balancer

The full picture, about 4 minutes of reading

What a load balancer is

A load balancer spreads incoming traffic across several servers, so that no single server is overloaded and the service keeps running if one of them fails. A server here simply means a computer that answers requests, for example by sending a web page or an app's data.

It works like the host at a busy restaurant. Guests arrive at one door. The host sees which tables and waiters are free and sends each guest to one of them. Guests do not need to know how many waiters there are or which one is on a break. They just get served.

Technically, a load balancer is a type of reverse proxy, a middleman that sits in front of servers and receives requests on their behalf.

Why it is needed

One server can only handle so much at once. When more people arrive than it can serve, pages slow down and eventually stop loading. Making that one server bigger helps up to a point, but it is expensive and still leaves a single point of failure: if that server crashes or needs an update, the whole service is down.

Running several identical servers solves both problems, but only if something decides where each request should go. That is the load balancer's job. It lets a service grow by adding servers instead of replacing them, and it lets servers be updated or repaired one at a time while the others keep working. For users, the result is a service that stays fast and available even when parts of it are not.

How it decides where to send traffic

Every request first reaches the load balancer. It then picks a server using a rule. The simplest is round robin: take turns, one request to each server in order. Another is least connections: send the request to the server that is currently handling the fewest. Some rules also consider how powerful each server is, or send users from one region to the nearest data center.

Some services need a user to keep talking to the same server during a visit, for example while a shopping cart is stored there. The load balancer can then remember which server each user was sent to, a feature often called sticky sessions.

At the same time, the load balancer runs health checks. It regularly asks each server a small question. A server that does not answer correctly is taken out of rotation until it recovers, so users are not sent to a broken machine.

Where it can go wrong

A load balancer removes one single point of failure but can become one itself. If it stops working, nothing gets through. That is why serious setups run more than one, or use a cloud service that handles this.

Health checks can mislead. A server may answer the check but still fail on real requests, for example because the database behind it is down. Good checks test what users actually need, not just that the server is switched on.

Uneven load is another issue. If some requests are much heavier than others, a simple take-turns rule may pile the heavy ones on the same server. And if all servers share one database, spreading traffic across them does not help when the database is the bottleneck. The load balancer moves traffic, it does not create capacity that is not there.

Why it matters for AI services

AI services are a clear example of uneven load. A short question to a language model may take a second, a long document analysis much longer. The servers running the models, often with expensive graphics processors, are costly and limited, so spreading the work well matters.

Load balancers in front of AI services therefore do more than take turns. They may consider how busy each server's queue is, route requests to the model version that fits, or send traffic to another provider or region if one is overloaded or down.

Companies that build on several AI providers sometimes use a similar idea in their own systems: a gateway that sends each request to the provider that is available, and falls back to another if the first fails. It keeps the service running when a single provider has problems.

What it means for a small business

A small business rarely sets up a load balancer itself. It is usually part of the services it already uses. Website hosts, web shop platforms, cloud services and AI providers all use load balancing behind the scenes, which is one reason they stay up on busy days.

The idea is still useful to understand. When choosing a hosting service for a website or web shop that must not go down, it is reasonable to ask how it handles traffic peaks and server failures. When a business system is critical, it is worth knowing whether it runs on one machine in a cupboard or on a setup that can survive one part failing.

And if your own tools depend on a single AI provider, it is worth knowing what happens if that provider is slow or down for an afternoon, and whether a fallback is possible.

Curious what this could mean for your company? Book a call.

Book a call