Load balancer costs explained: hours plus traffic
A load balancer receives requests and spreads them across servers. Every cloud sells one, and every one is billed in two parts: a charge for existing and a charge for the work it does.
The two parts
An hourly charge. The load balancer costs a fixed amount per hour while it exists, even with no traffic. This is why a forgotten test environment keeps billing.
A usage charge. On top of the hourly charge, you pay for how much traffic or how many connections it handles. The unit differs by vendor. AWS bills in load balancer capacity units, which take the highest of new connections, active connections, data processed and rule evaluations. Azure Application Gateway bills in capacity units. Google bills per forwarding rule and per gigabyte of data processed. Oracle bills a flexible load balancer per hour with a bandwidth setting.
Read the vendor’s page for the exact definition. The shape is always an hourly price plus a usage price.
Which one a comparison uses
The web app estimate includes one HTTP load balancer on each cloud, chosen as the closest equivalent: AWS Application Load Balancer, Azure Application Gateway, Google’s external Application Load Balancer and Oracle’s Flexible Load Balancer. They are comparable as layer 7 balancers, and not as network (layer 4) balancers, which price differently.
What makes the usage charge grow
- Traffic volume. More data processed costs more.
- Many short connections. New connections per second can be the highest of the usage measures.
- Long-lived connections, such as WebSockets, which hold the active connection count high.
- Complex rules. Many routing rules and TLS settings can raise the measure on some vendors.
Ways to spend less
- Share one load balancer between several services by routing on host name or path, where your security model allows.
- Delete test environments’ balancers when you finish.
- Do not put a balancer in front of a service that has one instance and does not need one, unless you want its health checks or TLS handling.
- Terminate TLS once. Do not stack a CDN, a balancer and a proxy that each decrypt the traffic without a reason.
- Check whether a CDN would take the traffic first, reducing what the balancer handles. See using a CDN.
What it does not include
The traffic that leaves the cloud, which is billed separately as egress, and the servers behind the balancer. See data transfer costs.
Balancers and resilience
A load balancer is usually what makes a multi-zone design work: it sends traffic only to healthy servers. See Multi-AZ and high availability. A private network adds another line item, the NAT gateway, covered in NAT gateway and private networking costs.