Welcome to Dream.In.Code
Getting Help is Easy!

Join 119,692 Programmers for FREE! Ask your question and get quick answers from experts. There are 2,081 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



How a CDN & IPAnyCast Makes DIC Faster

 
Reply to this topicStart new topic

> How a CDN & IPAnyCast Makes DIC Faster

skyhawk133
Group Icon



post 15 Jun, 2008 - 09:52 AM
Post #1


As Dream.In.Code has grown, delivering our content faster, and more reliably to countries all over the world has become very important. I'd like to tell you how I've leveraged several new(er) technologies to make DIC as fast and reliable as it is today.


1. Faster DNS Lookups w/ IPAnyCast

If you own a domain, you probably have NS1.YOURWEBHOST.COM and NS2.YOURWEBHOST.COM. Typically, these server(s) are in the same datacenter, or might even be on the same server. Ideally, you want geographically separated servers and no fewer than 2 completely different servers. But why you ask? If my server is down along with my DNS servers, nobody can get to my site anyway. That's true, but wouldn't you like to be able to move your web site to a new host quickly and not have to wait the 2-3 days for your domain to re-propagate?

Enter services like UltraDNS, EasyDNS, DNSMadeEasy, and many others. They provide redundant, geographically separated DNS servers. This keeps your eggs out of one basket (i.e. your web host), and gives you the control to move your site to a new host quickly.

That's great and all, but we can take geographically separated one step further and say "geographically closest". Using IP AnyCast technology, visitors to your site will be routed to the closest geographical DNS server. Dream.In.Code uses DNSMadeEasy which has over 20 servers located around the world. Visitors are routed to the closest (and often quickest) DNS server. This makes the time from "click" to the time the page starts downloading just that much quicker.

Here's an example of IP AnyCast in the US:
IPB Image


2. Content Delivery Network

Content Delivery Networks (CDNs) are nothing new. Big sites have been using the services of Akamai and others for years. But with the popularity of online video and larger file sizes, CDNs are becoming more and more popular (and accessible) for the little guys.

CDNs address 2 major problems. The first being limitations in the browser. Computers are faster, servers are faster, and connections are faster. So why can't we download more than 3 things at once with Internet Explorer? Because IE has a built-in limit to only open 3 simultaneous connections to any 1 host at a time. This is why a couple months ago I moved all the static content on DIC to static.dreamincode.net. This tricks IE in to downloading more things at once. But, this also puts tremendous strain on my web servers. In fact, the server went from handling around 30 HTTP requests/second, to over 60 HTTP requests/second. Moving all the static content to a CDN fixes this.

IPB Image

The second problem CDNs address is distribution. Delivering static content, video, or large files is very resource intensive. A CDN caches that content on multiple Points of Presence (POP) around the world and delivers it using one of many POPs. This allows for almost unlimited scalability. Again, it is possible to take this a step further using IPAnyCast to deliver the content from the closest geographical POP.

Dream.In.Code has been using CDNLayer from SoftLayer (which is ultimately provided by Internap). CDNLayer let's us do what's called "Origin Pull" which essentially pulls the files requested from our web server and caches them on the POPs (as opposed to us uploading every image, CSS, page, etc.). If you look at the source code, you'll notice references to http://http.cdnlayer.com/dreamincode/ this address translates directly to http://www.dreamincode.net/ so any file requested from the CDN is cached and delivered.

Let's take a look at why IPAnyCast (for DNS or a CDN) makes things so much quicker. Below are 2 traceroutes from Europe. One is coming back to Dallas (where the DIC Datacenter is) and the other is going to the CDN (and hitting the London POP):

Attached Image
Attached Image

You'll notice from Europe, it takes 19 hops to get back to our Dallas server. With the CDN, it only takes 10. And the maximum response time is only 32ms compared to 334ms back to Dallas.

So the combination of using IPAnyCasted DNS and an IPAnyCasted CDN speeds up content delivery dramatically, and takes a lot of strain off the web server. Price wise it's not bad either, I'm paying $59.95/yr for the DNS and $20/mo for the CDN (up to 200GB/mo)

You can read more about IPAnyCast here:

http://www.dnsmadeeasy.com/s0306/res/ipanycast.html

And more about the CDN we're using here:

http://www.softlayer.com/services_cdnlayer.html
Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!

ZachR
Group Icon



post 19 Jun, 2008 - 12:35 AM
Post #2
Wow, This IPAnyCast is pretty helpful. Thanks again for the post Chris! biggrin.gif
Go to the top of the page
+Quote Post

ozziffied
Group Icon



post 24 Jun, 2008 - 11:26 PM
Post #3
openDNS.org let's you put parental features and they even show the status of all of their DNS servers!!
Go to the top of the page
+Quote Post

skyhawk133
Group Icon



post 28 Jun, 2008 - 10:20 AM
Post #4
openDNS != the kind of DNS I'm talking about.


Go to the top of the page
+Quote Post


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 10/15/08 12:14PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month