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.

Out of curiosity, I wanted to know, how Wordpress.com scale their architecture, specifically:

  1. how they handle sub-domains.

    I believe they have millions of subdomains.CMIIW. How do they scale their DNS to handle it?

  2. They also support custom domains.

    How do they handle the translation and also, how do they scale the requests?

note, I choose the wordpress tag, because I'm not allowed yet to create wordpress.com tag.

share|improve this question
1  
It's seems automatic doesn't communicate much. Edublogs has given some tips, and you can also see the Q&A How does Wordpress scale –  rds Nov 21 '11 at 10:33
    
I've read this: wordpress.stackexchange.com/questions/1162/… but it basically tell how to scale on application side. I was wondering, how to do the dns side. –  ariefbayu Nov 21 '11 at 10:49
add comment

2 Answers 2

This probably isn't the right place to ask this question but;

1) Subdomains

I'd imagine they just have a wildcard subdomain. If you run the dig tool you get a response like this;

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> test.wordpress.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62954
;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;test.wordpress.com.            IN      A

;; ANSWER SECTION:
test.wordpress.com.     14400   IN      CNAME   lb.wordpress.com.
lb.wordpress.com.       300     IN      A       76.74.254.120
lb.wordpress.com.       300     IN      A       76.74.254.123
lb.wordpress.com.       300     IN      A       72.233.2.58
lb.wordpress.com.       300     IN      A       72.233.69.6
lb.wordpress.com.       300     IN      A       74.200.243.251
lb.wordpress.com.       300     IN      A       74.200.244.59

;; Query time: 237 msec
;; SERVER: 192.168.16.103#53(192.168.16.103)
;; WHEN: Mon Nov 21 10:27:33 2011
;; MSG SIZE  rcvd: 149

That's a bit of a mouth-full, but here's a basic breakdown;

test.wordpress.com.     14400   IN      CNAME   lb.wordpress.com.

test.wordpress.com, or any subdomain of wordpress.com, is a CNAME to lb.wordpress.com (I assume 'lb' is 'load balancer'). lb.wordpress.com contains some A records that point to their servers. On the server side, they most likely have the configuration set so *.wordpress.com CNAME's to lb.wordpress.com, then when they need to add/remove/modify servers they can change the settings for lb.wordpress.com.

2) Custom domains.

This is really more of an application side issue, every* HTTP request sends a HTTP header containing the host. This can be accessed from the application, for example in PHP you can get this value with $_SERVER['HTTP_HOST']. Then it's simply a matter of looking up which 'user' a HTTP host belongs too and returning the content. To understand this a bit more I'd suggest you look into the way Wordpress MU, Wordpress Networks (MU was 'discontinued'/it was integrated into the core of Wordpress standard) and the 'Wordpress MU Domain Mapping' plugin work.

*Most, in fact you can pretty much depend on the Host: header being sent. Any client that doesn't send Host headers will likely run into many other issues.

share|improve this answer
    
Hmm... so they play with some sort of load balancing the DNS request with all those lb.wordpress.com. Interesting... –  ariefbayu Nov 21 '11 at 10:49
    
@silent The IP's of lb.wordpress.com all point to NGINX servers(1) which forward the requests to the app servers, at a guess I'd say behind those NGINX balancers they've got a couple of hundred app servers and a good few database/caching servers - (1)wiki.nginx.org/Main –  sam Nov 21 '11 at 11:07
add comment

I suggest you to search on http://highscalability.com/blog/ and follow it.

They have few articles on wordpress scalability.

@SAM you can never know how wordpress.com is scaled by doing dig or dns brute forcing.

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.