888.4.NATNET
Facebook Twitter LinkIn Blog Instagram YouTube Google Plus
07
Sep
2010

Do I Need a CDN?

by Administrator

What exactly is a CDN?

As someone who runs a hosting company, I get this question on a regular basis as we have a couple of different CDN offerings. Many people have heard of a CDN, usually from a friend or an online article, but few people know what it does or how it works, so let’s start with a definition and overview.

CDN is short for Content Delivery Network. CDNs were created to deal with proximity issues when delivering content from a web site. What this means is that the further away the surfer is from your web site, the slower it will load for them. If your web site is hosted in the US, a surfer in the US is going to see much faster load times than a surfer in Australia, simply because they are closer to the web site server.

A CDN consists of storage servers called “caching servers” or “edge servers” that are strategically placed around the world. Web site content is pulled from the “origin server” (the server that hosts your web site) and is pushed to all the edge servers. When a surfer makes a request for that content, the CDN first determines where the surfer is, then finds the nearest edge server to the surfer and finally confirms that the requested content is on the edge server. If the content exists on that edge server, it delivers that content from the edge server to the surfer, thus providing faster delivery of the CDN content to the surfer. If the CDN determines that the content should exist on the edge server but for some reason does not exist, it will pull it from the origin server and place it on the edge server. By using href tags in the HTML code for the site, the webmaster can control what content should be on the CDN and what content should be delivered directly from the origin server. Now that we know what a CDN is, let’s determine if you need one.

In the description above, we learn that a CDN has to go through a decision process to determine what to do (where is the surfer, does the content exist, etc). This decision process takes a second or two, which can add a delay to the loading of the content. Due to this decision process, it should be apparent that a CDN is not ideal for all sites or all content. A CDN was designed with larger content (files) where a 1 second delay is not critical. A CDN is also designed for “popular content” i.e., content that is accessed often. Edge servers do not have infinite disk space so all CDNs automatically expire or delete content on the edge servers if the content has not been accessed in some time. This time span is configurable by the site owner but usually it’s 30 days. So, it would not make sense to put up content that is only accessed occasionally.

A typical web site is hosted in a single location at a hosting company, and the web site usually consists of web pages of text and images and has been, or SHOULD BE optimized for the best performance. If a web site is properly optimized, it should load pretty quickly from anywhere in the world. Text is very small and most web site images are very small as well. Putting this small content on a CDN will actually defeat the purpose due to the decision process explained above. However, if you have large images, large downloads (zip files, software files, etc) or movie files, a CDN is perfect for this application, provided you have popular content to deliver. We have found that the best use of a CDN is to deliver the web site text and smaller images directly from the origin server and put the larger files on the CDN, thus providing a “best of both worlds” experience for the surfer. Large streaming movies will play much faster on the CDN. Large zip file downloads will download much more quickly on the CDN. The one exception to putting smaller files on the CDN would be a JavaScript file, or some other file that never changes and is always loaded on every page. We have seen some customers use the CDN for JavaScript files and have good success with them.

What a CDN is NOT good for…

CDN edge servers are just very large disk arrays and they are very good at delivering content; however, they are not designed for processing, so you usually cannot put php files or any other scripts/programs that require server side processing. You can put javascript on them because it is processed on the client side by the browser. CDN providers want their edge servers to “shovel content” to the surfer and nothing more. Adding in server side processing would simply slow down the CDN and also create a new level of un-needed complexity.

CDNs are also not cheap. Because of the infrastructure required, as well as the software that runs it, there is a significant investment required to build a CDN. This means that CDN bandwidth can run 2-10 times more than regular bandwidth provided by your hosting company.

Finally, if most of your surfers are in the same area as your web site, i.e., your web site is in the US and most of your surfers are in the US, there is no benefit to having a CDN, as you’ll be paying extra but not really seeing any faster speeds.

So, if you have a web site that delivers larger files, whether streamed or downloaded, you have surfers all over the world and you wish to give them the best possible experience, it may be time to see if YOU need a CDN.

Share and Enjoy
  • Print
  • Facebook
  • Twitter
  • Add to favorites
  • RSS
  • Google Bookmarks
  • Technorati
  • Yahoo! Buzz
NationalNet, Inc., Internet - Web Hosting, Marietta, GA
Apache Linux MySQL Cisco CPanel Intel Wowza