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.

We're currently developing several websites using 2 web front-end servers (using apache and tomcat/jboss) with a loadbalancer in front of them. Since I'm a programmer, not a sysadmin, I can only guess what a decent hardware loadbalancer is capable of. I was wondering if a hardware loadbalancer can check on HTTP status codes, so the traffic would be redirected to only one server if the other one is down for maintenance (which now sends out a 503 HTTP error code).

Thanks!

Ben

share|improve this question
    
Do you have a specific model in mind? –  Matt Aug 28 '09 at 13:29
    
Well, no, we generally work with hosting providers to perform these kind of tasks. But it really helps if I know what I'm talking about in meetings with them... so I can assess they know their stuff, so I only have to worry about my code. Most of the time, this isn't the case. –  Ben Aug 28 '09 at 20:13
    
Is there any such thing as a hardware load balancer? Everything runs software at some point; I doubt that any vendor would put health checking into ASICs. –  Wim Kerkhoff Aug 18 '11 at 3:03

3 Answers 3

up vote 7 down vote accepted

Yes, practically all load balancers will do that. Most load balancers will also go further, and take a dead HTTP server out of service if it:

  • just times out or does not respond to TCP/IP
  • does not respond with valid HTTP within a set timeout, i.e. the TCP socket is connected but no HTTP, or HTTP sends a 200 OK but does not answer to HTTP OPTIONS etc.
  • if a specific status page does not contain a specific pre-set text string / does not match a preset MD5 hash. This is very handy for checking that the connection to the database is up (by programming a simple page which reads some data from the DB and displays it).

Edit: Addtionally, good load balancers have an easy way of setting a server into maintenance mode, i.e. the load balancer will stop sending new requests to that server, and will show in its UI when the server stops having traffic. Then you can freely perform the required maintenance on the server, before putting it back into service.

Additionally, most load balancers have a concept of a emergency server, i.e. if all regular HTTP servers are down, all traffic will be sent to a designated emergency server on your LAN which can then deliver a static "we're down for maintenance, check back later" page.

Coyote Point makes nice low-end load balancer appliances IMHO. There are many other vendors of low-end load balancers; Barracuda is one example. 'Low-end' is not negative in this context, it is just that the market is split into two:

  • 'low-end' vendors, who typically charge at most 20000 USD or so for their top products, and sell both directly and via small resellers.
  • 'enterprise vendors' like F5, Cisco, Foundry etc who may charge much more, and use a premium brand sales model.

If the OP has no sysadmin skills in-house, then purchasing a low-maintenance appliance makes a lot of sense. If you're willing and capable of setting up a Unix server, then take a look at this post. If you're on Microsoft Windows, then Microsoft Application Request Routing version 1 or 2 (beta) could be good solutions (I don't know them so well).

share|improve this answer
    
Superb answer, just the info I needed. Thanks! –  Ben Aug 28 '09 at 20:15
    
excellent response...I would add, however, that this should be something that you invest in to hire/contract the right people for. Hardware load balancers can be a significant boost to your uptime, but they can also obscure, obfuscate, and outright hide problems because you've lost the direct link between the request and response. Some of them allow you to mitigate that a bit by passing in additional header fields with the missing information, but correct configuration is a must. –  Greeblesnort Aug 29 '09 at 1:57

Apache/tomcat certainly can - look at the documentation for "fail_on_status".

share|improve this answer
    
I'm aware Apache can do load balancing, I was looking for a hardware alternative. But thanks for the pointer, this can be handy for, erhm, plan B :-) –  Ben Aug 28 '09 at 20:14

BigIP load balancers can do that. But you don't need to get a big hardware LB to have good performance. Check out nginx, and varnish. Varnish specifically was written as a caching load balancer and is highly configurable. http://varnish.projects.linpro.no/

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.