AWS Cost Efficiency

AWS Elastic Load Balancing (ELB): Pricing Breakdown and Cost Optimization

Did you know?

ELB processed over 35 quintillion requests in 2021. That's a 35 followed by 18 zeros (35,000,000,000,000,000,000)! This massive number showcases the immense scale and traffic handling capabilities of ELB within the AWS cloud.

To ensure smooth and efficient operation of your applications, it is important to understand how AWS Elastic Load Balancers (ELBs) work.

By learning about features such as listener rules, target groups, and autoscaling, you can maximize the benefits of ELBs to improve your application's performance.

With this knowledge, you can make informed decisions when setting up your infrastructure, enabling your applications to scale easily and provide optimal service to your users while also reducing and optimising ELB costs.

AWS Load Balancer Pricing Overview: Understanding AWS ELB Pricing and Cost

  • Classic Load Balancer (CLB) Pricing: AWS Classic Load Balancer Pricing

Pricing depends on the number of Classic Load Balancer-hours used and the amount of data processed by the load balancer.

  • Application Load Balancer (ALB) Pricing: AWS ALB Pricing and Costs

Pricing is influenced by the number of Application Load Balancer hours utilized, the number of Load Balancer Capacity Units (LCUs) consumed, and, if applicable, the usage of the Trust Store for Mutual TLS.

AWS Application Load Balancers’ feature HTTP header based routing enabled us to meet the requirements during peak seasons to ensure the best customer experience. With Application Load Balancers, we can scale our services 10x, meeting peak demand for apps running on EC2. - Neeraj S Chauhan - Chief Information Officer, PayU[3]

  • Network Load Balancer (NLB) Pricing: AWS NLB Pricing and Costs

Pricing is determined by the number of Network Load Balancer-hours utilized and the consumption of Network Load Capacity Units (NLCUs).

The built-in elasticity of the Application Load Balancers and Network Load Balancers are integral in ensuring that NuData Security’s flagship product, NuDetect, can authenticate users to help prevent an increasing amount of fraudulent activity in our customers' environments in real time. - Ian Cheng - Director, DevOps Engineering, NuData[3]

  • Gateway Load Balancer (GWLB) Pricing: AWS GWLB Pricing and Costs

Pricing is based on the number of Gateway Load Balancer-hours used per Availability Zone (AZ) and the consumption of Gateway Load Capacity Units (GLCUs).

Below is an overview of the pricing structure for Elastic Load Balancer in the Asia Pacific (Mumbai) region.[1]

Load Balancer Type
Hourly Rate Per Unit Data
Classic Load Balancer  $0.025  $0.008 per GB of data processed 
Application Load Balancer  $0.0239  $0.008 per LCU-hour (or partial hour) 
Network Load Balancer  $0.0225  $0.006 per NLCU-hour (or partial hour) 
Gateway Load Balancer  $0.0125 per AZ  $0.004 per GLCU-hour (or partial hour) 

Factors Affecting ELB Costs: Elastic Load Balancing Pricing and Cost Breakdown

To effectively manage your ELB costs, selecting the appropriate ELB for your infrastructure setup is crucial. Therefore, it is vital to thoroughly comprehend the key comparison factors among the several types of load balancers.[2]

Features
Classic Load Balancer Application Load Balancer Network Load Balancer
Gateway Load Balancer
Protocol Support  TCP, SSL/TLS, HTTP, HTTPS  HTTP, HTTPS  TCP, TLS  N/A 
Layer Supported Network  Layer 7  Layer 7  Layer 4  Layer 3 Gateway + Layer 4 Load Balancing 
LCU  N/A  $0.008 per LCU-hour (or partial hour)  $0.006 per NLCU-hour (or partial hour)  $0.004 per GLCU-hour (or partial hour) 
Performance  Moderate  Slowest  Fastest  N/A 
Path Routing  Not Supported  Yes  Not Supported  N/A 
Sticky Sessions  Yes, redirected to same machine  Yes, redirected to same target  Not Supported  N/A 
Static/Elastic IP  Not Supported  Not Supported  Yes  N/A 
Load Balancing for Multiple Ports  Not Supported  Yes  Yes  N/A 
Idle Connection Configuration  Yes  Yes  No  N/A 
Preserve Source IP  Not Supported  Not Supported  Yes  N/A 
Support Targets outside AWS  Not Supported  Yes  Yes  N/A 
Cost Differences (per use case configuration)  $24.09  $22.27  $20.81  $0.0125 per AZ 

AWS Load Balancer Pricing: Evaluating Classic, ALB, NLB, and GWLB Dimensions

Understanding the pricing breakdown of various ELBs involves analyzing key dimensions such as new connections, active connections, processed bytes, and rule evaluations. These metrics determine the cost of load balancing services and play a crucial role in optimising expenses while ensuring efficient traffic distribution.

Pricing Dimension
Classic Load Balancer Application Load Balancer Network Load Balancer
Gateway Load Balancer
New Connections  N/A  25 per second  TCP: 800 per second,

UDP: 400 per second,

TLS: 50 per second
 
600 per second 
Active Connections  N/A  3,000 per minute, (1,500 with Mutual TLS)   TCP: 100,000 per minute,

UDP: 50,000 per minute,

TLS: 3,000 per minute
 
600 per second 
Processed Bytes  $0.008 per GB  1 GB per hour  1 GB per hour for TCP, UDP, TLS  1 GB per hour 
Rule evaluation  N/A  1,000 per second  N/A  N/A 

Image for understanding pricing of AWS ELB
Representation of various load balancers with respect to Elastic Load Balancer Cost Dimensions

Monthly Cost Analysis of Different AWS Load Balancers: Usage Scenarios and ELB Charges

Different AWS Load Balancers incur varying monthly charges based on usage scenarios and components.

Load Balancer Type
Scenario Components Charge
Classic Load Balancer  Medium-sized website with 10 EC2 instances in US East (N. Virginia) using one load balancer for traffic balancing 
  • Data Transfer: 100 GB
  • Load Balancer Hours: $18
 
  • Cost of data transfer = 100 GB * $0.008/GB = $0.80
  • Total cost = Load Balancer Hours cost + Data Transfer cost = $18 + $0.80 = $18.80
 
Application Load Balancer  Average of one new connection per second, each lasting two minutes, five requests per second, 300 KB per second data transfer, and 60 configured routing rules 
  • New Connections: 0.04 LCUs
  • Active Connections: 0.04 LCUs
  • Processed Bytes: 1.08 LCUs
  • Rule Evaluations: 0.25 LCUs
 
  • New Connections:0.04 LCUs * $15.89 per LCU ≈ $0.64
  • Active Connections:0.04 LCUs * $15.89 per LCU ≈ $0.64
  • Processed Bytes:1.08 LCUs * $15.89 per LCU ≈ $17.15
  • Rule Evaluations: 0.25 LCUs * $15.89 per LCU ≈ $3.97
  • Total Cost = ≈ $0.64 + $0.64 + $17.15 + $3.97 ≈ $22.40
 
Network Load Balancer  Application receives one new TCP connection per second, lasting two minutes, consuming 300 KB in processed bytes 
  • Active Connections (TCP): 0.0012 NLCUs
  • Bytes Processed (TCP): 1.08 LCUs
 
  • Cost for Active Connections (TCP):0.0012 NLCUs * Cost per LCU = 0.0012 NLCUs * $15.89 per LCU= ≈ $0.019068
  • Cost for Bytes Processed (TCP):1.08 LCUs * Cost per LCU = 1.08 LCUs * $15.89 per LCU= ≈ $17.1592
  • Processed Bytes:1.08 LCUs * $15.89 per LCU ≈ $17.15
  • Total Cost = $0.019068 + $17.1592 ≈ $17.178268
 
Gateway Load Balancer  Single-zone Gateway Load Balancer and a Gateway Load Balancer Endpoint handling incoming connections for the application  
  • New Connections: 0.00167 GLCUs
  • Active Connections: 0.002 GLCUs
  • Bytes Processed: 1.08 GLCUs
  • Hourly Charge: $0.00432
 
  • Total GLCUs per Hour = 0.00167 GLCUs + 0.002 GLCUs + 1.08 GLCUs = 1.08367 GLCUs
  • Total Charge per Hour = $0.00432 * 1.08367 GLCUs ≈ $0.00467
 
Endpoint    
  • Hourly Charge: $0.0138
 
  • Total Usage Cost per Hour = Total Charge / Total Hours of Usage = $9.94 / 719.28 hours ≈ $0.0138
 

Strategies for Optimizing AWS Load Balancer Costs: Tips for Reducing AWS Load Balancer Charges

1. Migrate from Classic Load Balancer (CLB) to Application Load Balancer (ALB)

Transitioning from CLB to ALB minimizes ELB costs through granular billing, resource efficiency, enhanced performance, flexible routing, and built-in security, leading to optimised resource utilization and lower expenses.

Here's an example using AWS CLI to create an ALB and migrate from CLB:

# Create a new ALB
aws elbv2 create-load-balancer --name my-alb --subnets subnet-12345678 subnet-23456789 --security-groups sg-12345678

# Create a target group for the ALB
aws elbv2 create-target-group --name my-targets --protocol HTTP --port 80 --vpc-id vpc-12345678

# Register targets with the target group
aws elbv2 register-targets --target-group-arn arn:aws:elasticloadbalancing:region:account-id:targetgroup/my-targets/12345678abcdef --targets Id=i-12345678 Id=i-23456789

# Create a listener for the ALB
aws elbv2 create-listener --load-balancer-arn arn:aws:elasticloadbalancing:region:account-id:loadbalancer/app/my-alb/12345678abcdef --protocol HTTP --port 80 --default-actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:region:account-id:targetgroup/my-targets/12345678abcdef

2. Use Amazon S3 and CloudFront for Static File Delivery

Leveraging Amazon S3 and CloudFront for static file delivery reduces ELB costs by offloading static content serving to CloudFront's edge locations, minimising requests to the ELB, lowering data transfer costs, and enhancing performance for dynamic content.

Here's an example using AWS SDK for Python (Boto3) to configure S3 and CloudFront:

import boto3

# Create an S3 bucket
s3 = boto3.client('s3')
s3.create_bucket(Bucket='my-static-files')

# Upload static files to the S3 bucket
s3.upload_file('path/to/local/file', 'my-static-files', 'file')

# Create a CloudFront distribution
cf = boto3.client('cloudfront')
cf.create_distribution(
    DistributionConfig={
        'CallerReference': 'my-distribution',
        'Origins': {'Quantity': 1, 'Items': [{'Id': 'myS3Origin', 'DomainName': 'my-static-files.s3.amazonaws.com'}]},
        'DefaultCacheBehavior': {'TargetOriginId': 'myS3Origin', 'ViewerProtocolPolicy': 'redirect-to-https', 'AllowedMethods': {'Quantity': 2, 'Items': ['HEAD', 'GET']}},
        'Enabled': True
    }
)

3. SSL/TLS Offloading

SSL/TLS offloading reduces ELB costs by transferring the decryption process from the load balancer to backend servers, enhancing efficiency, potentially reducing the need for additional ELB instances, and maintaining secure communication between clients and servers.

Here's an example using AWS CLI to configure SSL/TLS offloading on an ALB:

# Create a new ALB with SSL/TLS offloading
aws elbv2 create-load-balancer --name my-alb --subnets subnet-12345678 subnet-23456789 --security-groups sg-12345678

# Create a target group for the ALB
aws elbv2 create-target-group --name my-targets --protocol HTTP --port 80 --vpc-id vpc-12345678

# Register targets with the target group
aws elbv2 register-targets --target-group-arn arn:aws:elasticloadbalancing:region:account-id:targetgroup/my-targets/12345678abcdef --targets Id=i-12345678 Id=i-23456789

# Create a listener for the ALB with SSL/TLS offloading
aws elbv2 create-listener --load-balancer-arn arn:aws:elasticloadbalancing:region:account-id:loadbalancer/app/my-alb/12345678abcdef --protocol HTTPS --port 443 --certificates CertificateArn=arn:aws:acm:region:account-id:certificate/12345678-1234-1234-1234-123456789012 --default-actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:region:account-id:targetgroup/my-targets/12345678abcdef

4. Use Cost Optimization tools

AWS offers tools like Cost Explorer, Trusted Advisor, and Budgets to optimize ELB costs. Cost Explorer provides spending insights, Trusted Advisor offers optimization recommendations, and Budgets help set cost thresholds for alerts.

Conclusion

In summary, maximizing cost efficiency with AWS Elastic Load Balancing (ELB) optimization is crucial. By rightsizing resources, using auto-scaling, and monitoring costs with tools like AWS Cost Explorer, businesses can manage ELB expenses effectively.

Understanding pricing dimensions and making informed decisions based on usage patterns helps minimize unnecessary costs while maintaining high performance. With a proactive approach to optimization, businesses can save money while ensuring reliable service for their applications.

References

1. Application and Network Traffic Distribution - Elastic Load Balancing Pricing - AWS

2. Elastic Load Balancing

3. Elastic Load Balancing Customers

FAQs

1. How to save AWS load balancer cost?

To save on AWS load balancer costs, consider implementing Auto Scaling to dynamically adjust the number of instances based on traffic, which helps avoid over-provisioning. Right-size your instances by selecting the appropriate type and size based on your load requirements. Additionally, explore options like AWS spot instances for significant cost reductions and optimize your elastic load balancing pricing by monitoring load balancer charges.

2. What are the benefits of AWS ELB?

AWS Elastic Load Balancing (ELB) provides several benefits, including high availability by distributing traffic across multiple targets, which ensures reliability. It also offers scalability by automatically adjusting to handle increased traffic loads. ELB enhances security through integration with AWS security services like IAM and SSL/TLS termination. For cost management, understanding elastic load balancing cost helps maximize value.

3. How can I improve my load balancing with AWS?

Improving load balancing in AWS can be achieved by implementing health checks to route traffic to healthy instances, using multiple availability zones for redundancy, and optimizing routing algorithms based on your application's needs. Regularly monitor performance metrics and adjust configurations as necessary. Utilize AWS load balancer pricing models to ensure cost-effective operations.

4. Which AWS load balancer is mostly used?

The most commonly used AWS load balancer is the Application Load Balancer (ALB), which is ideal for HTTP/HTTPS traffic and provides advanced routing capabilities based on content. It is suitable for modern web applications and typically preferred for AWS application load balancer pricing due to its robust features and flexibility.

5. How to choose the right AWS load balancer?

When choosing the right AWS load balancer, consider the type of traffic (HTTP/HTTPS, TCP/UDP), required features (e.g., SSL termination, Web Sockets), and your application's architecture. Evaluate the performance, scalability, and cost implications of each type of load balancer, including ALB, NLB, and CLB, to determine the best fit. Look into AWS pricing load balancer options to align with your budget and requirements.

Subscribed !
Your information has been submitted
Oops! Something went wrong while submitting the form.

Similar Blog Posts

Maintain Control and Curb Wasted Spend!

Strategical use of SCPs saves more cloud cost than one can imagine. Astuto does that for you!