# Load balancers

> Distribute traffic across servers with health checks and free, automatically renewed TLS certificates.

Source: https://docs.avenlith.com/en/load-balancers  
Category: Networking  
Last updated: 2026-09-22

## Create a load balancer

```bash
avenlith lb create --name web-lb --region fra1 --algorithm least-connections
avenlith lb target add web-lb --server web-01 --server web-02 --port 8080
avenlith lb listener add web-lb --protocol https --port 443 --certificate auto \
  --domain www.example.com --health-path /healthz
```

The load balancer gets its own public IPv4 and IPv6 address. Point your DNS record at it and the certificate is issued automatically within a minute.

## Algorithms

| Algorithm | When to use |
| --- | --- |
| round-robin | Identical, stateless servers |
| least-connections | Long-lived or uneven requests |
| source-ip | Simple session stickiness |

## Health checks

Targets are checked every 5 seconds. After three failed checks a target is removed from rotation; it returns after two successful checks.

> **Tip:** > Make `/healthz` check your database connection too — a server that cannot reach its database should not receive traffic.

## Limits

Each load balancer handles up to 1 million concurrent connections and 40 Gbps. Shield Advanced adds layer 7 filtering in front of the listener.
