Linux.com

Silly question...

Posted by: Anonymous Coward on August 18, 2005 05:42 PM
What if either the machine running the balance program dies or the balance program itself fails? Does this mean that the balance machine itself is a single point of failure? I'd have thought you'd actually want a pool of machines each running balance and some sort of dynamically allocated virtual IP mechanism.


Because of this concern, I used the "holy trinity" of <a href="http://www.spread.org/" title="spread.org">spread</a spread.org>, <a href="http://www.backhand.org/wackamole/" title="backhand.org">wackamole</a backhand.org> and <a href="http://www.backhand.org/mod_backhand/" title="backhand.org">mod_backhand </a backhand.org> to balance Web servers. Some minor things to note about those 3 tools:


  • If you balance equally between machines, it uses a redirect mechanism, so you can end up with 2 log entries for some requests (one on the original machine and one on the machine it redirected to, assuming you are logging separately on each machine).


  • Spread/Wackamole seemed to "interfere" with NFS mounting, so I gave up trying to share filestore using NFS and wrote some tools to rsync between the machines in both directions whenever there's a filestore update. Besides, NFS introduces a single point of failure (the NFS server) and probably shouldn't be used when balancing machines. Yes, I looked at various distributed filesystems, but they were either buggy, unmaintained or a nightmare to set up.


  • You must listen on the base machine IPs *and* on the virtual IPs in your Apache conf file (i.e. your VirtualHost tag should have *3* IPs if you're balancing two machines using one virtual IP and are sharing the Apache httpd.conf between all machines [you should - the conf on all machines should be identical] - the docs definitely don't make this clear at all).


  • Watch out for PHP session files - they have to be synced frequently between machines or you have to code the IP in the session cookie and use the "sticky session" directive (but this locks your session to one machine, which sort of defeats balancing somewhat).

#

Return to Taking a load off: Load balancing with balance