Real world case study in slimming down bandwidth consumption

March 8, 2007 on 7:11 pm | In ajax, http |

One issue I keep coming back to here is the hidden, cumulative cost of bandwidth as traffic scales. Another case study showed up a few days ago from Jeff Atwood at Coding Horror. Using traffic patterns from a popular article published in February, he found 4 useful techniques for bandwidth optimization: offload images to a third party, use HTTP compression, offload RSS hosting, and compress JavaScript and CSS.

Offloading images ties in well to my discussion of connection parallelism back in December. Loyal readers will recall the tip for using DNS wildcards to trick the browser into assigning more connections to your host, but that does nothing to reduce your bandwidth costs. The solution I suggested is appropriate when you want to maximize connection parallelism and have bandwidth to spare.

Images hosted by a third party are allocated two connections, and none of the bandwidth tracks back to your infrastructure. I’m curious whether any of the third party hosts allow you to make use of the DNS hack to also get the benefits of 6 connections over their pipes. That would truly be the best of both worlds — outsourced hosting and as much parallelism as the browser can handle.

Jeff recommends using Amazon S3 for image hosting, and that echoes what I’ve heard from numerous other users. At $0.20 per GB transferred, it’s hard to argue with the economics. This is a great solution if you have the time or energy. If anyone knows whether DNS wildcarding works with S3, I would love to hear about it.

4 Comments »

RSS feed for comments on this post. TrackBack URI

  1. I wonder whether you could create your own service hosted on a number of separate lighttpd instances which handles retrieval out of s3 whilst giving you the variety in host names you need to beat the connection limit.

    Comment by wioota — March 10, 2007 #

  2. wiotta,
    That’s interesting, but in that approach you would need to proxy the connections back through S3, so you would be taking both an inbound (from S3) and outbound (to the client) bandwidth hit. I was hoping for a solution that gives the client 6 parallel connections to S3 without any bandwidth impact on us.
    Ryan

    Comment by Ryan Breen — March 10, 2007 #

  3. S3 works nicely with DNS virtual hosting. For example, if you create three buckets in S3 called mydomain-static[1-3], AWS will let you refer to those buckets as mydomain-staticN.s3.amazonaws.com. Thanks to S3’s REST interface, objects inside buckets can be addressed using the Request-URI path. You can also set up prettier domains like static1.mydomain.com using DNS CNAME records. See the S3 docs for more info.

    Comment by Buddy Brewer — March 13, 2007 #

  4. Great info, thanks Buddy.

    So, there you have it. S3 gives you the best of both worlds: no bandwidth impact on your host and 6 concurrent connections to the browser.

    Comment by Ryan Breen — March 13, 2007 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^