We’ve been using AWS ELBs for many years now across a variety of our cloud services. As someone from “the old times” who has configured hardware LBs before, they still seem like wizardry! Spin up an infinitely scalable load balancer via boto/CLI/console for only just over $20/month?! What a deal!

The $deal$ can end up being quite a chunk of the bottom line if you use enough ELBs though. Several years ago, we started decomposing one of our monoliths to a microservice pattern using ECS containers. For service discovery and scalability, we used an ELB per service with a Route53 endpoint for the load balancer. Predictable and scalable and with not too many services to start with, not overly expensive.

However, as the number of services increased, so the did the cost. When Application Load Balancers (ALBs) were released, we switched to these so we could use dynamic port mapping for our ECS containers. We continued to spin up a new load balancer per service using our “service-in-a-box” cloudformation pattern which works very well for deploying a service anywhere.

One thing to inject here is the environment cost multiplier effect we have here. For reasons not important to this article, we have many dev — test — prod environments that need to run these services. 9 in total. So while each load balancer is only approx. $20/month, it actually becomes $180/month with all the environments. And that’s on top of any other costs to run the actual service (ECS is VERY cost effective for running containerized services when using EC2 instances for the cluster; Fargate, not so much).

So we have a great pattern for deploying services but the cost is increasing linearly as we add more services. Alarm bells started to ring….