3

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?

5 Answers 5

5

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.

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.

2

The reason non www points to a different server is because you cannot have your naked domain resolve to a CNAME. It may works sometimes, but it's not officially supported. Which is why most companies will redirect the naked domain to the www, and so the naked domain only needs a fairly lightweight webserver even for a lot of requests.

2
  • 1
    This really has nothing to do with the question.
    – ceejayoz
    Aug 14, 2014 at 21:52
  • 4
    He asked why www is going to a cname while @ is not. Theoretically etsy would like to point both @ and www to the CDN, but they can't. Aug 14, 2014 at 22:01
1

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

1

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.

3
  • www.etsy.com points to cdn means that akamai is serving the dynamic content;which surprises me... Mar 1, 2011 at 9:25
  • 2
    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. Mar 1, 2011 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, 2011 at 13:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .