Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My website is growing too large for the one webserver that powers it to handle the traffic. Anticipating this, the code is perfectly capable of running in parallel, sharing a database, but I've never actually tried to split one IP address among several webservers. What kind of hardware or software do I need to divide up incoming TCP connections between multiple boxes? Bonus points if the system can detect that one or more boxes has gone offline.

share|improve this question
    
If you could shed some light on the operating system you're using for your website it would be easier to give recommendations. Both windows and linux has a few options for this. –  Trondh Sep 25 '09 at 12:18

5 Answers 5

up vote 7 down vote accepted

You need a load balancer. There are two kinds : software and hardware.

  • hardware : You buy a box that usually has a web interface and will split the traffic evenly between web servers. They usually have many features that allow you to do many things such as 802.1Q support, SFP, Global load balancing, SSL Termination, so on and so forth. These are quite expensive and you can get them from Cisco, F5, Radware, Barracuda (cheaper).

  • software : You get a standard server and you install load balancing software. This is quite easy to do with Linux. You can use either HAProxy or ldirectord or Keepalived. There are quite a few to chose from. This is a cheaper method but without all the pretty web interfaces and fun features.

Any half decent load balancing system will detect an offline server. All the above do.

share|improve this answer

You could use Varnish for this, or Pound two good and robust systems and varnish will even cache your site like a king and speed things up.

share|improve this answer

To add to what Antoine said, I would recommend a hardware load balancer if your site really is getting large. Software Load Balancers have a tendency to add a lot of overhead traffic on your network. Hardware Load Balancers are also usually designed with failover in mind since if not it becomes a single point of failure. As Atnoine mentioned they usually are very expensive. If you are a smaller shop I would recommend looking into a Load Balancer by Kemp Technologies, they are well made and perform well for a price that is literally a 10th of the big boys listed above. We are currently using a pair to Load Balance our website, student portal, and online learning portal at the online university where I run where we quite a bit of traffic everyday.

share|improve this answer
    
Kemp does look really nice ! Barracuda is quite cheap actually but they don't look half as good as Kemp. –  Antoine Benkemoun Sep 25 '09 at 13:30
    
Yes we actually looked at Barracudas and they have a horrible reputation for quality with their load balancers. Kemp actually uses the same software across all models, so the only difference between low and high is how much throughput the hardware can support. –  Charles Sep 25 '09 at 13:58

You can also kind of split up "services". Have one server handling requests for MySQL and the other handling web requests. You can also arrange it so that one is processing only images/static pages and the other handling dynamic requests. This should work regardless of operating systems and may provide some additional flexibility, but tightens the coupling of the servers.

share|improve this answer
    
This has a really mean tendancies to multiply SPOF. From a probabilistic point of view, you multiply the chance of failure by adding failure points to the chain of function. Take one down, you take everything down. –  Antoine Benkemoun Sep 26 '09 at 8:23

The cheap way to do this is to get another IP address and add it to the A record for the website. Requests will then randomly be directed to one machine or the other. This doesn't automatically handle failover for you though, nor does it guarantee session consistency.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.