What is load balancing?

A load balancer receives incoming connections and hands each one to a server in a pool, so no single machine carries all the traffic and a failed one is quietly skipped.

Why spread traffic across servers?

For capacity and for resilience. Once one machine cannot carry the peak, adding a second behind a balancer doubles headroom without changing the application. Just as important, the balancer checks each server and stops sending traffic to one that fails, so a crash or a maintenance reboot becomes a non-event for visitors. Even when one server could carry everything, two behind a balancer make deployments and kernel updates painless.

How do layer 4 and layer 7 balancers differ?

A layer 4 balancer routes by addresses and ports without reading the content, a layer 7 balancer reads the HTTP request and can route by host name, path, header or cookie. Layer 4 is faster and works for any TCP or UDP protocol, including databases, game servers and mail. Layer 7 can terminate TLS, send /api to one pool and images to another, add headers and retry a failed request on another server.

Layer 4Layer 7
Decides byIP and portHost, path, headers, cookies
ProtocolsAny TCP or UDPHTTP, HTTP/2, gRPC
TLSPassed throughUsually terminated
Open-source examplesHAProxy in TCP mode, IPVS, nftablesHAProxy, NGINX, Envoy, Traefik

Which balancing algorithm should I pick?

Least connections suits most web traffic; round robin is fine when requests are short and similar. Weighted variants let a bigger server take a larger share, which is useful when a pool mixes an ESSENTIAL-3 with a BUSINESS-4 2026. Source hashing sends each client address to the same server, a crude form of persistence. For long-lived connections such as WebSockets, least connections avoids piling every new user onto the server that happens to be next in rotation.

What are health checks?

Regular probes that decide whether a server stays in the pool. A TCP check only confirms the port opens; an HTTP check requests a path such as /healthz and expects a 200, which catches an application that is running but broken. Point the check at a page that tests the database connection too, keep it cheap, and set the failure count so a single slow response does not eject a healthy server.

How do I build a balancer on rented servers?

Run HAProxy or NGINX on a machine in front of the pool. We do not sell a managed load balancer product, but a small server with HAProxy handles tens of thousands of requests per second, far more than most pools need. A minimal HAProxy configuration for two application servers reached over WireGuard looks like this:

frontend site_in
    bind :443 ssl crt /etc/haproxy/certs/site.pem alpn h2,http/1.1
    default_backend app_pool
backend app_pool
    balance leastconn
    option httpchk GET /healthz
    http-check expect status 200
    server app-a 10.88.0.11:8080 check inter 3s fall 3 rise 2
    server app-b 10.88.0.12:8080 check inter 3s fall 3 rise 2

The balancer itself then becomes a single point of failure. Two common answers: publish both balancer addresses in DNS so clients retry the other one, or accept a short manual switch by lowering the DNS time to live. Floating IP addresses that move between machines are not sold here, so DNS-based failover is the practical route.

What about sticky sessions?

Avoid needing them if you can. Applications that keep session data in local memory force the balancer to send each user back to the same server, which unbalances the pool and loses sessions when that server restarts. Moving sessions to a shared store such as Redis or Valkey, or into signed cookies, frees the balancer to place every request wherever capacity exists. Our Redis servers and Valkey servers pages cover sizing for that store.

Can DNS alone balance load?

Loosely. Several A and AAAA records for one name make resolvers rotate among them, spreading clients across servers in different cities such as London and Toronto. DNS cannot see server health or load, and clients cache answers for the time to live, so it works best combined with a proper balancer in each location. Our How DNS works article explains caching behaviour.

Machines for a balancer and its pool

ModelProcessorCoresMemoryDrivesPortPer month
ESSENTIAL-2Intel Xeon-E 2388G832 GB2x 512 GB SSD NVMe1 Gbps unmetered$43.20
ESSENTIAL-SAMD Ryzen 7 9700X864 GB2x 512 GB SSD NVMe1 Gbps unmetered$46.20
BUSINESS-1 2024AMD EPYC 4244P632 GB2x 960 GB SSD NVMe3 Gbps unmetered$81.60
BUSINESS-2 2026AMD EPYC 4345P864 GB2x 960 GB SSD NVMe3 Gbps unmetered$141.60

Related pages

High availability

Designing services that keep answering through failures: availability targets, failover, quorum, replication and a practical two-machine pattern.

Read more

NGINX

The event-driven web server and reverse proxy explained: how workers handle connections, common configuration blocks, TLS, caching and tuning on bare metal.

Read more

High-traffic websites

Machines with fast cores and guaranteed 3 to 5 Gbps ports for news sites, forums, APIs and busy content platforms.

Read more

Server redundancy

Duplicating disks, power, network paths and whole machines so one failure does not stop a service, and which layers a renter controls.

Read more

Questions and answers

Do you sell a managed load balancer?

No. Install HAProxy, NGINX or Envoy on one of your servers instead. A small machine handles tens of thousands of requests per second.

What is the difference between layer 4 and layer 7 load balancing?

Layer 4 routes connections by IP address and port for any protocol. Layer 7 reads HTTP requests and can route by host name, path or header.

Which algorithm is best for websites?

Least connections works well for most web traffic because it sends new requests to the server with the fewest open ones, which also handles long-lived connections fairly.

How do I avoid the balancer becoming a single point of failure?

Run two balancers and list both in DNS, or keep a standby and switch DNS with a short time to live. Floating IP addresses are not offered here.

Do my servers need a private network for load balancing?

Not a product one. Link the balancer and pool over WireGuard on the public ports, which also encrypts the traffic between them.