views:

114

answers:

3

Say I have a web farm of six IIS 7 web servers, each running an identical ASP.NET application.

They are behind a hardware load balancer (say F5).

Can the load balancer detect when the ASP.NET application worker process is restarting and divert traffic away from that server until after the worker process has restarted?

A: 

We use a Cisco CSS 11501 series load balancer. The keepalive "content" we are checking on each server is actually a PHP script.

service ac11-192.168.1.11
  ip address 192.168.1.11
  keepalive type http
  keepalive method get
  keepalive uri "/LoadBalancer.php"
  keepalive hash "b026324c6904b2a9cb4b88d6d61c81d1"
  active

Because it is a dynamic script, we are able to tell it to check various aspects of the server, and return "1" if all is well, or "0" if not all is well.

In your case, you may be able to implement a similar check script that will not work if the ASP.NET application worker process is restarting (or down).

gahooa
A: 

It depends a lot on the polling interval of the load balancer, a request from the balancer has to fail in order before it can decide to divert traffic

Sander Rijken
A: 

What happens during an IIS restart is actually a roll-over process. A new IIS worker process starts that accepts new connections, while the old worker process continues to process existing connections.

This means that if you configure your load balancer to use a balancing algorithm other than simple round-robin, that it will tend to "naturally" divert some, but not all, connections away from the machine that's recycling. For example, with a "least connections" algorithm, connections will tend to hang around longer while a server is recycling. Or, with a performance or latency algorithm, the recycling server will suddenly appear slower to the load balancer.

However, unless you write some code or scripts that explicitly detect or recognize a recycle, that's about the best you can do--and in most environments, it's also really all you need.

RickNZ