views:

200

answers:

1

I know it's to do with having a variety of load balancing servers, but why do some sites make use of differently named "www" sub domains (www2.somesite.com, www3.somesite.com etc) where as other can be perfectly massive without doing this - ie all traffic is to www.hugesite.com.

Does it indicate certain architectural decisions / have a specific purpose? Can it be avoided or is it a limitation of having the site scale a certain way?

+1  A: 

www[n] is an easy way to add more more servers to cope with load since you can load balance very easily between the various servers - with www[n] you can just redirect the request to the appropriate server and forget about subsequent requests - because the client then deals with www1 or www2 etc... Adding more servers is simple... but it's non persistent in terms of subsequent requests

The alternative is for the load balancer to maintain a pool of backend nodes that are maintained "behind the scenes". It keeps track of which node the user has been allocated to - normally by using session cookies to identify which backend node the user has been allocated to. It just maintains a big in memory hashmap (effectively) of the session id's to backend nodes, delegating requests from a user's browser to the backend node each time... it's more complex to setup, but more powerful in the long run.

More info here: http://en.wikipedia.org/wiki/Load_balancing_%28computing%29

Jon
One correction.. it's not always wise to use sticky sessions. We have the one-frontend model with multiple application servers, but we don't use sticky sessions (or like them, for that matter)
Evert
Hi Evert, could you ellaborate on what you mean, I've specified that session cookies are a specific way of achieving this - there are others of course...
Jon