• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

1 site, 2 servers

posted by krakjoe, this got removed during a recent server migration so I'm posting it again (sorry!)

Well, assuming you want no extra hardware, or complicated - so called high availability - setups ...

The thing to do is use round robin DNS to distribute lookups for your domain across both nodes by creating A records for both nodes that point to your domain.

Round robin isn't fool proof, and isn't truly balanced ( it cannot be, for obvious reasons ), it is however, widely deployed by almost every big name on the internet as a way of distributing load, if all the clients and caches behave themselves you should be reasonably balanced under reasonable load (for the hardware) by pure chance.

Some datacenters offer some super cool extras, hardware load balancers spring right to the front of my mind: basically a box to be all boxes - it plugs into every machine, usually on separate ethernet hardware to the backbone. Using various bits of trickery it takes care of balancing load, failing over when a node goes down, routing sessions correctly and other such things ... these are not cheap, but usually worth it ... some offer shared balancers, and software solutions ... not so keen on those ( their expense usually far outweighs the cost of another server and setting up the software for myself )

The problem with round robin is that sessions can be lost, HTTP is supposed to be stateless, so round robin does nothing to prevent this ... of course, you can do something about this ... simple cookies/sessions will not be affected, if however you have a bunch of information stored in session on node A, node B may not have it ... a bunch of solutions exist, I'm sure you or others can think them up ...

To have a look at how round robin works in action, a suggestion might be to ping google.com over and over again and watch the address change, then dig for google.com records and you'll see what is going on in practice - everything with an A record in the zonefile is being rotated one after the other, most software obeys this standard, though it is not guaranteed, it's pretty reliable...
 
Back
Top