Which is faster: Cloudfront or S3?

Amazon Web Services’ S3 can be a pretty good and cheap approach to webhosting, serving files at a cost of  cents per 1000 hits.

How much of an improvement would it be to serve these files out of Amazon’s Cloudfront, the content delivery service that caches content around the world?

Here are the results of a brief experiment. In the month of June I served a 1.3 Megabyte sound file both from S3 and from Cloudfront to the WatchMouse monitoring network. I then measured the minimum time to connect, as well as the average download time for the two, and compared those across the locations from where they were downloaded.

The next table shows the minimum connect times in milliseconds.

Country City Cloudfront S3  
Ireland Dublin 0 0
United Kingdom Glasgow 1 12
Netherlands Amsterdam 0 14
France Lille 5 18
Belgium Antwerp 4 21
Germany Muenchen 6 31
Italy Padova 5 43
U.S.A. Chicago 2 102
U.S.A. Austin 5 120
U.S.A. San Francisco 2 150
Brazil Sao Paulo 0 202
Australia Melbourne 12 319

What is noticeable is that the connect time to the S3 service increases with the geographical distance from Ireland, which is where the main file is hosted. The connect time to S3 is much more constant and a lot lower. This is good for web users waiting for their webpage to build up.

The following table shows the average download times in milliseconds.

Country City Cloudfront S3
Ireland Dublin 181 343
United Kingdom Glasgow 535 614
Netherlands Amsterdam 388 657
France Lille 284 1029
Belgium Antwerp 406 882
Germany Muenchen 277 947
Italy Padova 582 1488
U.S.A. Chicago 402 2589
U.S.A. Austin 516 3291
U.S.A. San Francisco 341 5426
Brazil Sao Paulo 269 5082
Australia Melbourne 1769 6325

Again, we see that the S3 download times correlate with distance, and Cloudfront download times being much more constant across the world, as well as being consistently lower.

From a business perspective, it makes sense to use Cloudfront as it will deliver a better user experience, but be aware that Cloudfront costs can be between a bit smaller than S3 costs and up to two times higher.


One Comment on “Which is faster: Cloudfront or S3?

6 July 2012 at 14:03

That’s a great study you did there!  Very useful.

Leave a Reply