# Load balancer types

What the network types lb11, lb21 and lb31, the application type and the dedicated type each carry, reach and cost, and which features each one has.

The type is set when you create the load balancer and never changes. No type is the API's
default: `type` is required. The console's create form starts on `lb11`.

## Network types: `lb11`, `lb21`, `lb31`

A load balancer at the infrastructure provider, in three sizes. The console describes them as:

| Type   | Connections | Targets |
| ------ | ----------- | ------- |
| `lb11` | 10,000      | 25      |
| `lb21` | 20,000      | 75      |
| `lb31` | 40,000      | 150     |

- Services: `tcp`, `http` and `https` on any port.
- Targets: instances and IP addresses. Created with a VPC (`vpcId`), it joins that VPC's network
  and can reach an instance over its private address (`usePrivateIp`). Joining a VPC is possible
  at creation only, and only through the CLI, API or Terraform.
- Health checks every 3 to 60 seconds.
- A target's `status` is not updated from the health check: it shows `healthy` from the moment
  the target is added.
- An uploaded certificate's private key is handed to the provider and not stored by Deutsche Cloud.
- If the provider has the type sold out, the create fails and the load balancer goes to `error`
  with the reason.

## `application`

An HTTP and HTTPS load balancer on the region's shared fleet of Deutsche Cloud machines, which carries
many organizations' application load balancers on the same addresses.

- Its own name at once: `<name>-<id8>.lb.apps.…` (the `hostname` field), served over http and,
  with a Deutsche Cloud certificate, over https.
- Services: `http` on port 80 and `https` on port 443 only; requests are told apart by host name.
  `tcp` and PROXY protocol are refused.
- Targets: public addresses only (an instance's public IPv4, or a public IP address); private and
  reserved addresses and the platform's own addresses are refused. In an organization whose load
  balancers run on its own hosts, an instance is reached at its site address instead. Targets join
  target groups.
- Host and path rules, a web ACL, live numbers and an access log.
- Health checks every 1 to 60 seconds. A target's `status` is the fleet's health check, `unknown`
  until the fleet has reported it.
- Every request to a target carries the header `X-EWS-LB-Token` with the load balancer's origin
  token, and the client's address in `X-Forwarded-For` and `X-Real-IP`. Other organizations' load
  balancers use the same source addresses: check the token on your targets if they must accept
  traffic from your load balancer only.
- Limits per load balancer: 10,000 connections, 20,000 requests a second (30,000 in the first
  second of a burst), 2,500 new TLS handshakes a second, 25 targets, 10 names including its own,
  50 rules, 10 target groups. Over the request rate a request is answered `429` with
  `Retry-After: 1`.
- €4.99 a month at most, billed per hour while active; 1 TB of traffic a month included.

## `dedicated`

A load balancer on the Deutsche Cloud fleet with addresses of its own, so it carries any port and
`tcp`. It is public or private, chosen at creation (`scheme`):

- **Public** (the default): its own IPv4 and IPv6. Targets are reached over their public
  addresses, with the same rules as for `application`.
- **Private** (`scheme: "private"` with `vpcId`): no public address. It has two addresses in the
  VPC, one on each of the two load balancer machines of your organization attached to that VPC,
  and both serve. Connect by its name (`hostname`), which answers the address of each machine
  serving now. Targets are instances in that VPC, or addresses inside the VPC's range. The VPC must
  already have its network: create an instance or database in it first. A VPC holds at most 5
  such address pairs.

Both:

- Services: `tcp`, `http` and `https` on any port except 22, 9901 and 9902, at most 10. PROXY
  protocol to targets (as on `lb11`–`lb31`). A separate health-check port (`healthCheckPort`)
  and, for `tcp`, `closeOnUnhealthy` are available on this type only.
- Sticky sessions are accepted on `http` and `https` services but not applied: the fleet does
  not pin clients of a `dedicated` load balancer.
- Health checks every 1 to 60 seconds. A new target shows `healthy`; from the fleet's first
  report on, its `status` is the fleet's health check.
- Limits per load balancer: 10,000 connections, 2,000 new tcp connections a second, 20,000 http
  requests a second, 2,500 new TLS handshakes a second, 25 targets, 10 services.
- Live numbers and an access log; no rules, target groups or web ACL.
- €6.99 a month at most, public and private alike, billed per hour while active.

## Features by type

|                                     | `lb11`–`lb31`        | `application` | `dedicated`            |
| ----------------------------------- | -------------------- | ------------- | ---------------------- |
| Protocols                           | tcp, http, https     | http, https   | tcp, http, https       |
| Ports                               | any                  | 80 and 443    | any but 22, 9901, 9902 |
| Targets in a VPC                    | yes (`usePrivateIp`) | no            | private scheme only    |
| Shortest health-check interval      | 3 s                  | 1 s           | 1 s                    |
| Target status from the health check | no                   | yes           | yes                    |
| Host and path rules, target groups  | no                   | yes           | no                     |
| Web ACL                             | no                   | yes           | no                     |
| Live numbers, access log            | no                   | yes           | yes                    |
| PROXY protocol, health-check port   | PROXY protocol only  | no            | yes                    |

## Related

- [Create a load balancer](create-a-load-balancer.md)
- [Health checks](health-checks.md)
- [What runs on your machines](what-runs-on-your-machines.md)
