3

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

Ben
  • 183
  • 1
  • 8
  • 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 03:03

3 Answers3

8

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).

  • 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 01:57
1

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

RainyRat
  • 3,730
  • 1
  • 24
  • 29
  • 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
1

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/

Nick Anderson
  • 679
  • 2
  • 5
  • 11