Content Distribution Networks any good?

2010 July 2 at 11:14 » Tagged as :broadband, cloud, nosql,

CloudFront, built upon Amazon S3 is a useful cloud hosting solution because there are no monthly commitments. You pay for the bandwidth you use. Well you do end up paying twice for bandwidth unless you are smart enough to use proper cache control mechanisms. Even then CloudFront is probably more suitable for small businesses than other Content Distribtion Networks like Akamai or Cachefly because they all have monthly commitments.

It is debatable whether using a CDN will speed up your site. In fact, I just discovered that using Cloudfront actually appears to be slower than just using S3 or indeed delivering static content from an Elastic Compute Cloud server.

Page load times all content on an EC2 server
Page load times all content on an EC2 server

Static content from Amazon Cloud Front
Static content from Amazon Cloud Front

Static content from Amazon S3
http://images.raditha.com/blog/images/aws/s3hosting1.png

The reason for this apparent slowdown is that CDNs are generally geared to send you route you to the closest geographic location. The closest geographic location may not always be the closest network path. Even they are the same, it's still possible that there is less bandwidth in the fiber optic cables for that location, as a result if lots of surfers are connecting to that location, you might find things a little bit slow.

Users from Sri Lanka are directed to the CloudFront servers in Singapore. Even though Singapore is much closer to me than the United States, most traffic from Sri Lanka ends up heading Westwards towards US than eastwards towards Singapore. The same applies for most parts of South Asia including India.  Most ISPs in different parts of the world are better equipped to route traffic towards the US than towards other countries for the simple reason that historically a vast majority of web servers were located in the US. In fact the business model of small web hosting companies is to rent out racks full of servers from large us hosting companies and to sublet them to their customers. Which means, whenever you connect to the website of the office across the street from yours, you are actually accessing a server in the United States.