teh bigbro blog(tm)
Bigbro's foray into the scary world of blogging

Fri, 30 Jun 2006

ApacheCon '06 : Performance Tuning Apache Part 2 - Scaling Out

Sander Temme
Most websites that handle more than a moderate amount of traffic, or are responsible for generation of revenue, should probably think about scalability and reliability. These are good things to have, but cost money.

The reality is that moving parts break: hard disks, fans, hard disks, power supplies and HARD DISKS are all prone to failure. Hard disks are not all born equal - buy good ones with reliability and the longest warranty. Mirror disks, use RAID - and remember, RAID will not help if you're not notified of failures. Redundant power supplies are great, especially if they're plugged into different circuits.

You can load balance using various techniques, e.g. F5, Alteon, DNS Round Robin, Cisco, Juniper, etc. DNS Round robin is the cheapest and most simple, but also most prone to failure because clients cache DNS info - so if a server fails, any clients with its IP address will continue to fail.
Network Load Balancer is a technology that comes with Windows Server 2003 - it's application independant so should work with Apache. It works with up to 32 hosts and all hosts in the cluster assume the same IP and MAC address. NLB makes the decision as to which server answers the TCP handshake, which determines which host is responsible for the connection.

Linux Virtual Server is an ip virtual server module that comes with the linux kernel.

Apache mod_proxy and mod_balance can be used to load balance. This includes some clever stuff that you can do with Jakarta and TomCat using IP Multicast, which means that if the Apache load balancer detects at a machine has died, the connection will stay up and it will get another server to handle the request.

Sander demoed a mod_jk example which load balanced between 3 tomcat instances, displaying the debug logs as we went and killed things. Everything worked seamlessly. Note that your objects in your web applications must be serialisable, otherwise load balancing will fail with mod_jk. Many applications do not adhere to that and are not clusterable.

More information and slides at: people.apache.org
posted at: 16:49 | path: /technical | permanent link to this entry


copyright © 2005-2008, Gareth Eason