Software Development's Magic Triangle
There’s an old adage “Fast, Cheap, Good; Pick Two”. This situation is called a magic triangle. …
Amazon has done it again bringing another computing service to the masses. This time it’s the Content Delivery Network or CDN. Cloudfront is a direct competitor to other popular CDNs such as Akamai. While Akamai requires a fairly substantial amount of traffic to become a customer, Cloudfront doesn’t. It follows all of Amazons, pay for what you use mentality. This means that everyone can benefit from incorporating Cloudfront into their blog, site, store, etc..
For purposes of experimentation, I decided to track how much of a difference Amazons Cloudfront made over simple s3 public hosting vs hosting locally on my webhost. I decided to usestevefrancia.com for this experiment since it is a very small and simple site with a single html file a couple css and js files and a handful of images. No server side processing or other significant variables, perfect for benchmarking.
The next series of images shows the improvement as I moved towards all files (except the primary html file) on cloudfront.
Note, the scale of the following images isn’t the same from one to the other, please note the x-axis scale for each one
Cloudfront is a significant improvement over both my web host as well as serving files directly from s3. Each case the single HTML file was served from my web host. When you remove that from the totals (assuming an average of .5 s for the index.html file) it shows an even larger improvement. From just under 4 seconds in our base case, to around .4 seconds on cloudfront. Using cloudfront is easy and inexpensive. CloudFront integration is a no brainer. It works well, easily integrates and is inexpensive. Most people should use it to host all of their resources.
Of course this is a very small scale test and your mileage will vary, pingdom is a good resource for simple tests like this as it produces the graphs seen above and is easy to use.