Is possible to reduce AWS data transfer costs using any other AWS resource?

5,584

Solution 1

Option 1

Try Amazon Lightsail: https://aws.amazon.com/lightsail. With the $5 plan you get 1T free monthly transfer.

Option 2

Use Cloudflare as your CDN. With Cloudflare free plan you get free unlimited data transfer. Cloudflare will cache your media files on their own server.

Solution 2

Configure CloudFront in front of your site -- EC2 and (perhaps eventually also) S3.

In the default configuration, you'll save whenever your viewers are in a less costly part of the globe, because data transfer out of S3 and EC2 toward CloudFront is $0, while data transfer out of CloudFront to the Internet is based on the location of the viewer.

However... CloudFront also has 3 pricing tiers, and selecting one of the lower cost tiers comes with a little bonus: CloudFront will probably route much of your traffic through lower cost edge locations, yet they reserve the right to use any of the higher cost regions yet will never bill you the higher cost rates, even if they do.

Note that Amazon CloudFront may still occasionally serve requests for your content from an edge location in a location that is not included in your price class. When this occurs, you will only be charged the rates for the least expensive location in your price class.

https://aws.amazon.com/cloudfront/pricing/

Is there a catch? I'd suggest that there is not, and I'd further suggest that there is a viable reason why it could cost you less to haul your traffic a potentially longer distance. This arrangement allows CloudFront to carry your traffic out of the higher cost region not using the (expensive) Internet links at the point of origin but rather over private fiber optic links they own, and into a lower cost region... and then drop it onto the Internet, where Internet costs are lower.

The highest priced plan will of course achieve the best performance, but the trade-off for switching to one of the lower cost plans may not make a difference in performance or at least not one that negates the benefit of the potential cost savings.

Solution 3

The short is answer is no, you will not save anything. Data transfer fees for South America are among the highest that Amazon offers. South America (SA) is about three times more expensive than US rates.

EC2 Data Transfer Out to Internet pricing for SA: First 1 GB free, up to 10 TB / month $0.25 per GB.

Amazon S3 Data Transfer Out to Internet pricing for SA: First 1 GB free, up to 10 TB / month $0.25 per GB.

Amazon CloudFront Data Transfer Out to Internet pricing for SA: First 10 TB / month $0.25 per GB.

EC2 Pricing

S3 Pricing

CloudFront Pricing

Share:
5,584

Related videos on Youtube

Daniel Santos
Author by

Daniel Santos

Professional and hobbist developer.

Updated on September 18, 2022

Comments

  • Daniel Santos
    Daniel Santos over 1 year

    I do have a AWS EC2 instance that contains a very large blog. My data transfer is about 200Gb/month. 80% of it are only media and images.

    My data transfer costs are high due the server location in south america (where our customers are).

    I was wondering if I could reduce those costs moving the heavy media data from a EC2 volume to a S3 or even caching it into a cloud front.

    Is that possible?

  • Daniel Santos
    Daniel Santos over 6 years
    There is no other option? or any suggestion? I would appreciate.
  • John Hanley
    John Hanley over 6 years
    I would use S3 (not CloudFront) in the us-east-1 region. I don't think the delays will be that noticeable for your customers. This will reduce your costs by 67%.
  • John Hanley
    John Hanley over 6 years
    I would also use more than one bucket so that the end user's browser can do parallel downloads. For example try to balance the CSS, JS and images into different domain names. The debugger feature in Chrome (and others) will help you see the network activity. You can get major improvements in response time this way.
  • Michael - sqlbot
    Michael - sqlbot over 6 years
    @JohnHanley note that CloudFront supports HTTP/2, translating it to HTTP/1.1 toward the origin... speaking of parallel downloads.
  • John Hanley
    John Hanley over 6 years
    @Michael-sqlbot - Hi :). Yes, but he is trying to reduce costs. Can you control the CloudFront distribution points? My recommendation is to use S3 in us-east-1 (he is in South America) as it is 3x cheaper than sa-east-1.
  • Daniel Santos
    Daniel Santos about 6 years
    Wow, it is much more cheper... But I'm confused. What are the advantage for using EC2 than Amazon Lightsail?
  • John Hanley
    John Hanley about 6 years
    Option #1. Review carefully what you get with LightSail. There are many reasons that the service is so inexpensive. Option #2. You will still pay for data transfer from EC2 / S3 to CloudFlare.
  • Elect2
    Elect2 about 6 years
    @JohnHanley "80% of it are only media and images" and can be cached on Cloudflare edges. So the cost will be greatly reduced, that's what the question was asked about.
  • Elect2
    Elect2 about 6 years
    @DanielSantos There are many: stackoverflow.com/questions/40927189/…. But if ec2 is the only aws product you need, and just for a personal blog, I'd recommend Lightsail, or even DigitalOcean(you will save more money). Note that Lightsail $5 plan limit CPU usage at 5%(equal to t2.nano).
  • John Hanley
    John Hanley about 6 years
    @StanHou . The question does not mention personal blog. In that case a CDN is not going to do much caching as there won't be enough demand to keep the files in the CDN's cache. On paper LightSail and CloudFlare look good in regards to cheap but you will get what you pay for. Real world testing will help point to the best implementation.
  • Elect2
    Elect2 about 6 years
    @JohnHanley When 200G/Mo(around $20 dollars/Mo) means something to a large blog, we can guess it is a personal blog. Even a company cares $20/Mo, I will also not recommend AWS to them. Cloudflare file expires based on TTL, not "number of demand". Plz clarify "you will get what you pay for" in details for this case.
  • shiouming
    shiouming over 5 years
    I enter 500GB into AWS cost calculator, CloudFront's data transfer cost is 5 - 6% lower than S3's. Is that the max CloudFront can save?
  • Michael - sqlbot
    Michael - sqlbot over 5 years
    @shiouming that is what you save if the bucket and the viewers are in the lowest cost regions. The savings in the case in the original question could be substantially higher if viewers are in lower cost regions while the content is in a higher cost region, because transport from the origin to the CloudFront edge isn't billed.
  • Bao Tran
    Bao Tran over 4 years
    How about data from Lightsail to cloudfront , does it cost ?