How does CloudFront in front of an ALB impact EC2 data transfer costs?

0

My EC2 instances send data out through an Application Load Balancer. I am trying to figure out two things:

  1. Would putting CloudFront in front of the ALB reduce my EC2 data transfer costs?
  2. Will this change impact the cost of running the ALB itself (LCU)?
1 Answer
0
Accepted Answer

1/ CF will very likely be cheaper, 2/ ALB will be cheaper with Amazon CloudFront in front of it.

To address Question 1:

  • both CF DTO and EC2 DTO are tiered, but CF DTO is cheaper - how much cheaper depends on the amount of data and location / region,
  • CloudFront has Always Free 1TB monthly DTO free vs 100GB only for EC2 / regional data transfer,
  • customers have access to CloudFront data transfer savings bundle in the console for 30% cheaper DTO,
  • further private pricing options available for customers using more than 10TB / month,
  • finally, DTO from EC2/ regions to CloudFront is free,
  • keep in mind additional per-request price on CloudFront, but the first 10M requests each month are free.

To address Question 2:

  • thanks to connection reuse from CloudFront edge locations to the LB, you will see a lower amount of new, as well as active connections on your ALB. It will be CloudFront PoPs that are terminating connections from the viewers,
  • ALB will only see connections from a much lower number of CloudFront hosts - this directly translates to lower LCU and therefore cost, and better performance

See our blog on how to Accelerate, protect and make dynamic workloads delivery cost efficient with Amazon CloudFront.

Please note that this is on top of more cost, availability and performance benefits that CloudFront offers for static and cacheable content. You can also have a look at Cost-Optimizing your AWS architectures by utilizing Amazon CloudFront features.

AWS
Piotrek
answered 12 days ago
EXPERT
Leo K
reviewed 12 days ago