Apache Failover and Load Balancing [duplicate]

+1 for Scalable Internet Architectures.

What I'd do, is sit down and look at what's currently running on the server in question.

I'm going to assume for now that you're running linux, although you didn't explicitly say this. What you want to look at is Varnish. It's a high performance reverse-proxy and load-balancer. You can set it up following the online examples here and it should be straightforward to get working.

If you have 2 varnish nodes out of 3 servers, point 1/3 of the traffic to each of the servers, arranged as a round-robin assignment. These 2 servers need unique public IP addresses, and you can set multiple A records in DNS to do RoundRobin DNS (RRDNS).

If your service is critically important to the business, and your last outage cost serious money, you might want to argue for a more resillient and redundant network. Assuming you currently only have one server, on one IP provided by one supplier, if your previous outage was network related, you might find that increasing the network resilience would improve your uptime.

Look hard at your monitoring also, make sure you're monitoring things on the server(s) that could bring the server(s) down, SMART data on the hard disks, free swap space, free memory, free / disk space. Get Nagios and Munin set up. Nagios to alert when critical monitoring conditions are met, and Munin to graph these data.

You'll probably have to make some application level changes too. Assuming your application(s) are session based, you'll need some way to handle the user's requests not always going to the same server. You could make them client side, or server-side and sticky. You'll probably find that memcached will help you greatly here.
As for application level changes, you might want to ask on StackOverflow, as they're more code-y and less server-y.


If your company is serious about this, they could consider a device like the Cisco CSS Content Services Switch 11501 series. We use this device with several web/app servers to both balance load and provide redundancy.


If you don't have money to buy load balancers, you can make an Apache server load balancer by configuring mod_proxy_balancer. To make your architecture completely redundant, you will need to run two instances of your load balancer and you can point your domain to both IPs. The other option is to use VRRP or CARP described in Theo's book which will require help from networking operation team.