1

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
  • 158
  • 1
  • 8

3 Answers3

2

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

John Hanley
  • 4,287
  • 1
  • 9
  • 20
  • There is no other option? or any suggestion? I would appreciate. – Daniel Santos Jan 16 '18 at 23:15
  • 2
    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 Jan 16 '18 at 23:21
  • 2
    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. – John Hanley Jan 16 '18 at 23:24
  • @JohnHanley note that CloudFront supports HTTP/2, translating it to HTTP/1.1 toward the origin... speaking of parallel downloads. – Michael - sqlbot Jan 17 '18 at 03:40
  • @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. – John Hanley Jan 17 '18 at 05:46
  • @JohnHanley yes, you can. Noted in my answer, you can configure CloudFront to restrict your distribution to lower priced edge locations, which may or may not disable traffic flowing through the higher cost edges but will limit the actual charges. – Michael - sqlbot Jan 17 '18 at 13:41
  • How about data from Lightsail to cloudfront , does it cost ? – Bao Tran Nov 08 '19 at 08:39
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.

Michael - sqlbot
  • 21,988
  • 1
  • 57
  • 81
  • 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? – shiouming Oct 28 '18 at 08:12
  • 1
    @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. – Michael - sqlbot Oct 28 '18 at 23:11
2

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.

Elect2
  • 176
  • 7
  • Wow, it is much more cheper... But I'm confused. What are the advantage for using EC2 than Amazon Lightsail? – Daniel Santos Jan 23 '18 at 01:31
  • 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. – John Hanley Jan 23 '18 at 16:29
  • @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 Jan 23 '18 at 16:51
  • 1
    @DanielSantos There are many: https://stackoverflow.com/questions/40927189/what-is-difference-between-lightsail-and-ec2. 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). – Elect2 Jan 23 '18 at 17:03
  • @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. – John Hanley Jan 23 '18 at 19:53
  • @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. – Elect2 Jan 23 '18 at 20:05