CDNs aren't the only way to reach more usersyou could add more IIS servers instead. However, adding enough Web servers to meet your site's maximum-capacity requirements is an expensive proposition. In fact, the need to build to peak-capacity requirements is one of the greatest inefficiencies of large-scale Web sites. If your Web site requires 100 servers to meet its peak requirements, you must buy the servers and network capacity up front and pay the administrators to manage these resources year-round, even if you hit peak capacity only once in a year (or not at all). Most of the year, your Web servers will work far below maximum capacity, and precious computing and networking resources will be wasted.
CDN service providers eliminate this inefficiency by offering multiple Web sites a shared infrastructure. Companies purchase a subscription to a CDN, and the service provider distributes their Web sites to tens, hundreds, or thousands of different CDN cache nodes. A CDN cache node might serve pages for hundreds of different Web sites. Efficiency results because, in theory, the Web sites that share space on a CDN won't hit their peak-capacity requirements at the same time. A local news Web site might hit its peak utilization during local elections; an e-commerce site is at its busiest during the holiday shopping season; a movie site takes numerous hits near the movie release date; and an online tax service spikes in the days or weeks leading up to April 15. Because the peak requirements for these Web sites fall at different times of the year, the sites make more efficient use of processing power and network capacity than if they each relied on purely dedicated solutions.
September 11, 2001, was an extraordinarily busy day for news Web sites. Fortunately, most of the major news organizations use CDNs. CDN service providers recognized the importance of getting the latest news to Internet users and dynamically increased news Web sites' resource allocation. Of course, allocating additional resources to news organizations meant resources were taken away from other types of sites. This situation illustrates both the key advantage and disadvantage of CDNsyou should have more capacity when you need it, but the possibility exists that the high demands of other Web sites will steal resources from you.
The bandwidth of your Internet connection is another factor that can limit your Web site's performance. Consider this example: Your Web site uses an average of 700Kbps of bandwidth on a T1 line to your ISP that can carry about 1500Kbps of traffic. However, you want the site to continue to function well during periods of peak utilization, in which traffic can soar to as much as 10 times the average utilization. To handle 7000Kbps of Web traffic, you could purchase more costly bandwidth from your ISP or have a CDN service provider cache your content to reduce traffic at your location. A CDN that cached 90 percent of your content would reduce the bandwidth requirement on your ISP connection to 70Kbps average and 700Kbps peak, making your current T1 connection sufficient.
CDN pricing structures vary. Typically, CDN providers bill customers on a monthly basis. Customers commit to a minimal amount of bandwidth and are charged every month for this bandwidth, whether they use it or not. If they burst above this bandwidth during a given month, they're charged at the burst rate for the month. For example, if you consume an average of 3Mbps for 3 weeks out of the month but burst to 10Mbps during the other week, your provider will charge you for 10Mbps for that month.
CDN Gotchas
Proxy servers and CDN cache nodes were originally designed to cache static content. As Web pages have become more complex, Web servers have begun to dynamically generate more content. All IIS administrators are familiar with Active Server Pages (ASP) applications, which return standard HTML to the end user but which IIS generates dynamically as the user requests them. Most commercial IIS sites have a Microsoft SQL Server database that ASP applications query for information such as personal preferences, product catalogs, and shipping information. IIS generates these types of pages independently for each incoming request, so today's CDNs can't cache them (although future CDNs will probably be able to).
Some CDN providers deceptively claim to cache dynamic content. What they might be doing is caching the results of ASP pages that don't change between requests. For example, a CDN can cache a page that contains an ASP command that simply directs the page to include another HTML file, as in
<! #include virtual="toolbar.htm" >
Before you write off CDNs, thinking that your Web pages are too dynamic to cache, consider that static images account for the majority of the bandwidth that the average Web site generates. Even if IIS dynamically generates a page, the images in the page are almost always static.
When evaluating CDN providers, make sure you understand their routing algorithm. Serving content from the CDN cache node closest to the end user isn't as cut and dried as it might seem. Imagine that you're in a big city with one-way streets, construction detours, and traffic jams and you need to get to the nearest cash machine. In addition to a map of city streets and ATMs, you'd need up-to-the-minute traffic information. The Internet is far larger and more dynamic than even the largest city. The performance benefit a CDN can offer is only as good as the algorithm it uses to route users to the best cache node.