Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Why would someone point(CNAME) www.example.com to a cdn?
When I run host on Etsy, I get a

[c]$ host www.etsy.com
www.etsy.com is an alias for www.etsy.com.edgekey.net.
www.etsy.com.edgekey.net is an alias for e2463.b.akamaiedge.net.
e2463.b.akamaiedge.net has address 184.85.74.37 

while

[c]$ host etsy.com
etsy.com has address 38.106.64.20
etsy.com mail is handled by 10 mxin.mxes.net.

Why would someone do this?

share|improve this question
add comment

5 Answers 5

Because CDN'ing www is a Good Thing (TM).

We do this at www.huffingtonpost.com, its good for offloading ~90% of all http requests to our site (not an estimate, comes from the graphs). If developers just use a small handful of basic tricks such as ajax loading dynamic stuff for individuals and appending timestamps or svn checkout numbers to urls as a "just to make the url unique" value you can get instant publishing even with 90+% edge offloading.

Any reasonably high traffic site is going to build an http caching layer. The question is do you build and geo-co-locate your own clusters of squid/varnish servers, or do you write a check to akamai/cotendo/etc to do it.

That "geo" part is key too. There's 80 - 100ms of internet latency to cross the continental united states. Thats a huge drag to your west coast users if your site is hosted on the east coast.

share|improve this answer
add comment

One would CNAME www.etsy.com to a CDN as a form of delegation so that the Global Traffic Management service of that CDN (Akamai in this case) can determine the location of the DNS resolver querying for www.etsy.com and return the nearest edge from their CDN network.

For Akamai, I think domains which go through their own network are *.edgekey.net and *.edgesuite.net. In this case, the IP address returned will be owned by the CDN.

You could also CNAME to a record that eventually resolves to an IP address that you own. Such cases are purely considered for Traffic Management and you don't get 'caching network goodness' along with it. The advantage of such a setup is useful when you have presence/capacity in multiple geographic locations and just need a GTM system to hand over the nearest A record to a user who queries for www.example.com. In the case of Akamai, AFAIK all domains ending with .akadns.net are GTM-only.

Another way of attaining geographic failover is through anycasting, but that's beyond the scope of this question.

About why etsy.com points to an A record owned by them: You cannot CNAME base domain records. If you want fault tolerance on a base domain like that, you can delegate that domain to your CDN, but then you're handing over ownership, which I don't think etsy in this case would want. So, they patch things up by pointing it to one of their locations and 301'ing users to their www host to make them go through Akamai.

If 38.106.64.20 goes down, etsy.com will fail, but www.etsy.com will continue to work as long as etsy has more than one origin behind their www domain.

share|improve this answer
add comment

etsy.com just does a 301 redirect to www.etsy.com, where the request is handled by their CDN.

share|improve this answer
add comment

it may not be the best method for spreading load, but I guess their sysadmin setup the www.* subdomain to point to the CDN so that any spikes will be handled by that, and assuming the demographics of etsy, I would say most people visiting that site would be putting the www's in front.

as for why the non-www etsy points to a different server?

I would say that for other subdomains they all point to that one (or two) servers for more literate users and tasks.

Looking @ErikA's answer, I would say this agrees with mine. So if an admin were to visit (for instance) admin.etsy.com, it would go to the single server, whereas if that request first went to the cdn, if there was a problem with the CDN then none of the admin users could login without knowing the IP address.

share|improve this answer
    
www.etsy.com points to cdn means that akamai is serving the dynamic content;which surprises me... –  Quintin Par Mar 1 '11 at 9:25
1  
Akamai offers something they call Web Application Acceleration akamai.com/html/technology/products/waa.html. Which might do the trick. But I'm sure its also possible to integrate more with akamai, so the very dynamic parts of the pages go back to the etsy origins, but most images, css, javascript, and mostly static pages stay cached at the edge close to the user. –  becomingwisest Mar 1 '11 at 10:28
1  
@Quintin it may be that Akamai has only one or two servers ping the etsy primary server to receive all new changes and then propagates that out to the entire CDN. That way there is low load on etsy's 'backbone'. And the CDN could be updated as often as minute by minute without crushing the primary server. –  Patrick Mar 1 '11 at 13:50
add comment

traceroute reveals

etsy.com:

cogentco.com->38.106.64.20(Etsy inc through rwhois referral from cogentco)

www.etsy.com

ntt.net-> akamai cdn

Edit:

www.* ends to cdn and *.com ends in Etsy Inc IP. What is the reason behind this?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.