Cloudfront is Still 34x Faster than S3 Alone!
I was amazed how much attention my last blog post about the speed tests I had done after after enabling CloudFront on my S3 static content. The post was re-tweeted over and over on Twitter and today I even saw follow-ups of people saying they were going to investigate my claims. If nothing else this post has finally made me realize the power of Twitter as a viral knowledge base!
So I decided to follow up on the post to give some more specifics and back up my claims. In the last test I had migrated some static content such as images, stylesheets, and javascript files to S3 and then enabled CloudFront. This was to get some load of our servers on this content that is hit every single time that a page loads.
The speed tests that I ran last time around were on very small files such as stylesheets that are only a few kilobytes in size. I ran some more tests today and the results were very similar.
2.33KB File
S3 Test 1 - .4954 seconds
CF Test 1 - .0117 seconds (42x faster)
S3 Test 2- .5189 seconds
S3 Test 2 - .0079 seconds (65x faster)
1.51KB File
S3 Test 1 - .5107 seconds
CF Test 1 - .0525 seconds (10x faster)
S3 Test 2 - .2826 seconds
CF Test 2 - .0068 seconds (41x faster)
Now yesterday, I enabled the S3 domain where I host my videos for CloudFront as well. I haven't started using it live on the site yet, but I ran some tests tonight to see what difference it would make with a larger file.
31.7MB File
S3 Test 1 - 43.8165 seconds
CF Test 1 - 28.7885 seconds (1.5x faster)
S3 Test 2 - 63.4555 seconds
CF Test 2 - 28.5563 seconds (2.25x faster)
So you see the same kind of ratio certainly does not hold up for a very large file... but I didn't expect that it would! With that said though, downloading a full 15-35 seconds faster is nothing to sneeze at. That can definitely make a big difference to a user's experience or allow for higher quality videos.
One more observation... as I ran these tests over and over on the same file (many more times than just the two tests above) I noticed something. The S3 times could have a lot of variance in speed whereas CloudFront's speed was very consistent. On S3 I could get the stylesheet to download as fast as .19 seconds and as slow as .60 seconds (.5 was about average) and the video as you see above from around 40 seconds to over a minute. CloudFront meanwhile ranged from .0062 and .05 (average was around .0074) for the stylesheet and 25-30 seconds (average was 28) for the video.
Comments