AWS ELB Pricing & Optimization Guide
Elastic Load Balancing (ELB) is a load-balancer service provided by Amazon. It automatically distributes internet traffic to your server instances, like EC2, containers, or any underlying service sitting behind it in one or more availability zones.
If any of your server instances fail, you certainly don’t want those failures to be visible to your end users. ELB plays a vital role in managing a seamless user access experience across your applications by monitoring the health of its registered instances and directing the traffic flow to only healthy or active instances.
In this guide, you will learn about the types of load balancers provided by Amazon, their pricing models, and some quick tips for optimizing costs associated with them.
AWS ELB Pricing
The Elastic Load Balancing offered by Amazon has four flavors to choose from: Application Load Balancer, Network Load Balancer, Gateway Load Balancer, and Classic Load Balancer. Each of these load balancers offers high availability, automatic scaling, and strong security support for your applications.
ELB pricing also follows an AWS rule: “You only pay for what you use with your setup.” To properly bill you for your ELB usage, AWS has introduced a component called the Load Balancer Capacity Unit (LCU), which is an integral part of your billing calculation, along with the region you host your infrastructure.
The LCU is a metric that defines the maximum consumption of a resource in any one of these dimensions: new connections/flows, active connections/flows, and bandwidth and traffic processed by ELB. These LCUs are called Network Load Capacity Units (NLCUs) and Gateway Load Capacity Units (GLCU) for Network and Gateway Load Balancers, respectively.
The Classic Load Balancer billing is not done using the LCU metric, and for an Application Load Balancer, rule evaluations are considered an additional parameter to derive LCU consumption.
Let’s dive into each of the load balancers to understand their pricing models.
Application Load Balancer
The Application Load Balancer (ALB) works at an application layer that deals with HTTP/HTTPS traffic. It gives you the flexibility to define a wide range of rules on the incoming requests and, based on that, routes the request to underlining services.
ALB Pricing Model
AWS bills an ALB either per hour or partial hour, along with the number of LCU used per hour.
Use Case
Let’s assume that your application receives an average of twenty new connections per second and that each connection is active for one second. A client sends twenty requests per second and processes 1 GB of data per hour. You have configured five rules on the load balancer for evaluating client requests.
Calculation
Note | |
---|---|
Region | US East (Ohio) |
Standard charge for each load balancer | $0.0225 |
Standard charge for each LCU per hour | $0.008 |
Calculation Type | Formula | Evaluation | Final Value | AWS Statistics |
---|---|---|---|---|
ALB charge | number of load balancers * 0.0225 (AWS standard cost) * hours per month | 1 * 0.0225 * 730 | $16.43 | AWS assumes 730 hours on a monthly billing cycle |
New connection LCU | given new connections / new connections provided by LCU | 20/25 | 0.80 | each LCU provides 25 connections per second, averaged over an hour |
Active connection LCU | given active connections / provided active connections | 20/3,000 | 0.00666666666666667 | each LCU provides 3,000 active connections |
Rule evaluation LCU | max ((rule processed by application – free rules per request), $0) | max ((5-10), 0) = Max (-5, 0) | 0 | 10 free rule evaluations are provided |
Data processed LCU | data processed by LCU / data provided by LCU | 1/1 | 1 | each LCU provides 1 GB of data |
LCU cost | max (new connections, active connections, data processed, rule evaluations) | max (0.80, 0.00666666666666667, 0, 1) | 1 | |
Total ALB LCU cost | number of load balancers * consumed LCUs * 0.008 * hours in a month | 1 * 1 * 0.008 * 730 | $5.84 | AWS assumes 730 hours on a monthly billing cycle |
Total configuration charge on a monthly bill | monthly load balancer charge + monthly LCU charge | 16.43 + 5.84 | $22.27 |
Thus, for this use case, the monthly bill generated by AWS will be $22.27.
Network Load Balancer
The Network Load Balancer (NLB) works at layer 4 and can handle TCP, UDP, and TLS traffic. It is the most performant ELB and works with static IP addresses. You can also assign one elastic IP address per subnet. NLB supports registering targets by IP address, including the targets that are outside your load balancer VPC.
NLB Pricing Model
AWS billing for an NLB is either per hour or partial hour, along with the number of NLCU consumed.
Use Case
Let’s assume that your application receives an average of twenty new TCP connections per second and each connection is active for one second. A client processes 1 GB of data per hour.
Calculation
Note | |
---|---|
Region | US East (Ohio) |
Standard charge for each load balancer | $0.0225 |
Standard charge for each LCU per hour | $0.006 |
Calculation Type | Formula | Evaluation | Final Value | AWS Statistics |
---|---|---|---|---|
NLB charge | number of load balancers * 0.0225 (AWS standard cost) * hours per month | 1 * 0.0225 * 730 | $16.43 | AWS assumes 730 hours on a monthly billing cycle |
New TCP connection LCU | given new TCP connections / new TCP connections provided by LCU | 20/800 | 0.025 | each LCU provides 800 connections per second averaged over an hour |
Active TCP connection LCU | given active connections / provided active connections | 20/3,000 | 0.0002 | each LCU provides 3,000 active connections |
Data processed LCU | data processed by LCU / data provided by LCU | 1/1 | 1 | each LCU provides 1 GB of data |
LCU cost | max (new TCP connections, active TCP connections, data processed) | max (0.025, 0.0002, 1) | 1 | |
Total NLB LCU cost | number of load balancers * consumed LCUs * 0.006 * hours in a month | 1 * 1 * 0.006 * 730 | $4.38 | AWS assumes 730 hours on a monthly billing cycle |
Total configuration charge on a monthly bill | monthly load balancer charge + monthly LCU charge | 16.43 + 4.38 | $20.81 |
Thus, for this use case, the monthly bill generated by AWS will be $20.81.
Gateway Load Balancer
The Gateway Load Balancer (GWLB) works at the third layer and enables you to deploy, scale, and manage virtual appliances, such as firewalls and prevention and detection systems.
GLB Pricing Model
AWS bills a GWLB either per hour or partial hour, along with the number of GLCU used by the GWLB per hour.
Use Case
Let’s assume that your GWLB is configured to handle single-zone deployment with twenty new connections per second and each connection is active for one second and consumes 1 GB of data per hour.
Calculation
Note | |
---|---|
Region | US East (Ohio) |
Standard charge for each load balancer | $0.0125 |
Standard charge for each LCU per hour | $0.004 |
Standard charge for each endpoint | $0.01 |
Standard data processing charge for endpoint | $0.0035 |
Calculation Type | Formula | Evaluation | Final Value | AWS Statistics |
---|---|---|---|---|
GWLB charge | number of load balancers * 0.0225 (AWS standard cost) * hours per month | 1 * 0.0125 * 730 | $9.13 | AWS assumes 730 hours on a monthly billing cycle |
New connection LCU | given new connections / new connections provided by LCU | 20/600 | 0.0333333333333333 | each LCU provides 600 connections per second averaged over an hour |
Active connection LCU | given active connections / provided active connections | 20/60,000 | 0.000333333333333333 | each LCU provides 60,000 active connections |
Data processed LCU | data processed by LCU / data provided by LCU | 1 /1 | 1 | each LCU provides 1 GB of data |
LCU cost | max (new connections, active connections, data processed) | max (0.0003333333333333333, 0.0003333333333333333, 1) | 1 | |
Total GWLB LCU cost | number of load balancers * consumed LCUs * 0.004 * hours in a month | 1 * 1 * 0.004 * 730 | $2.92 | AWS assumes 730 hours on a monthly billing cycle |
GWLB endpoint | number of load balancer endpoints * 0.01 * hours in a month | 1 * 0.01 * 730 | $7.30 | AWS assumes 730 hours on a monthly billing cycle |
GWLB endpoint data processing | data processed per hour * 0.0035 * hours in a month | 1 * 0.0035 * 730 | $2.56 | AWS assumes 730 hours on a monthly billing cycle |
Total configuration charge on a monthly bill | monthly load balancer charge + monthly LCU charge + monthly endpoint charge + monthly endpoint data processing charge | 9.13 + 2.92 + 7.30 + 2.56 | $21.91 |
Thus, for this GWLB use case, the monthly bill generated by AWS will be $21.91.
Classic Load Balancer
The Classic Load Balancer (CLB) provides basic load balancing across multiple EC2 instances. It operates at the request as well as at the connection level.
CLB Pricing Model
AWS bills a CLB either per hour or partial hour for each gigabyte of data transferred. The CLB pricing does not include the LCU metric.
Use Case
Let’s assume here that one CLB is used to handle the traffic routing of multiple EC2 instances and consumes 1 GB of data per hour.
Calculation
The cost of running CLB per hour or partial hour can be calculated by determining the following: number of load balancers * 0.025 per hour (this is the standard cost used by AWS for US East [Ohio] region) * number of hours in a day * number of days in a month. Remember that AWS assumes there are 730 hours on a monthly billing cycle.
Calculation Type | Formula | Evaluation | Final Value | AWS Statistics |
---|---|---|---|---|
CLB charge | number of load balancers * 0.025 * hours in a month | 1 * 0.025 * 730 | $18.25 | AWS assumes 730 hours on a monthly billing cycle |
Data processed by CLB | data processed per hour * hours in a month | 1 * 730 | 730 GB | AWS assumes 730 hours on a monthly billing cycle |
Data processing charge | number of load balancers * data processed in a month * 0.008 | 1 * 730 * 0.008 | $5.84 | |
Total CLB cost | CLB charge + data processing charge | 18.25 + 5.84 | $24.09 |
Thus, for this CLB use case, the monthly bill generated by AWS will be $24.09.
ELB Cost Optimization
To manage your ELB costs, it’s imperative that you choose the right ELB for your infrastructure setup. Thus, it’s essential to understand the key comparison factors among the load balancers.
Features | Classic Load Balancer | Application Load Balancer | Network Load Balancer |
---|---|---|---|
Protocol support | TCP, SSL/TLS, HTTP, HTTPS | HTTP, HTTPS | TCP, TLS |
Performance | Moderate | Slowest | Fastest |
Path routing | Not supported | Yes | Not supported |
Sticky sessions | Yes, redirected to same machine | Yes, redirected to same target | Not supported |
Static/Elastic IP | Not supported | Not supported | Yes |
Load balancing for multiple ports | Not supported | Yes | Yes |
Idle connection configuration | Yes | Yes | No |
Preserve source IP | Not supported | Not supported | Yes |
Support targets outside AWS | Not supported | Yes | Yes |
Cost differences per use case configuration | $24.09 | $22.27 | $20.81 |
You can see that the cost differences among each ELB are not huge, but what is most important is to choose from the features provided by each that best suits your system requirements.
Conclusion
ELB provides high availability and fault tolerance of your applications evenly distributes traffic to registered instances, and effectively manages peaks. However, if you’re not careful, the ELB AWS pricing model can make your cost exponentially shoot up.
AWS ELB cost optimization starts with understanding your system requirements using monitoring tools, like AWS Cost Explorer, CloudWatch, and CloudForecast. With these tools in place, you can easily calculate your cost against your resources and create your AWS ELB budget plan.
CloudForecast provides an interactive dashboard that helps you effectively analyze, plan, and manage your costs. If you need help in visualizing your AWS ELB costs, CloudForecast is ready to assist.
Manage, track, and report your AWS spending in seconds — not hours
CloudForecast’s focused daily AWS cost monitoring reports to help busy engineering teams understand their AWS costs, rapidly respond to any overspends, and promote opportunities to save costs.
Monitor & Manage AWS Cost in Seconds — Not Hours
CloudForecast makes the tedious work of AWS cost monitoring less tedious.
More from CloudForecast
AWS cost management is easy with CloudForecast
We would love to learn more about the problems you are facing around AWS cost. Connect with us directly and we’ll schedule a time to chat!