1

We have an IIS7 running on several nodes in an NLB cluster. The NLB nodes are set to Affinity:None so that new connections are spread across them. We want KeepAlive switched on so that we can get better performance but we are finding that when one of the nodes in the cluster goes away all its traffic moves on to other nodes but never moves back. Although we are running web services we only have a few clients that do CPU intensive tasks so we are finding that one server will be being battered to death while the other sits there doing nothing!

We would like something like Apache's MaxKeepAliveRequests which limits the number of requests on a given connection so that IIS will periodically force clients to re-connect and therefore balance the cluster.

Is this something IIS7 supports? Is this what "normal" people do?

David Newcomb
  • 275
  • 1
  • 5
  • 14

2 Answers2

1

If it's a truly stateless session, you can disable KeepAlive altogether in IIS7 with:

appcmd set config /section:httpProtocol /allowKeepAlive:false

This shouldn't add a significant amount of overhead if most of the work is done by only a few clients. Be sure to test it first, though.

Hyppy
  • 15,608
  • 1
  • 38
  • 59
  • Thanks, but we want KeepAlive switched on. Connections are made from vast distances over potentially slow links so the connection time overhead could be significant. Fresh connections could be a buffering problem when streaming our media. – David Newcomb May 17 '11 at 11:31
1

I couldn't find a suitable solution, so wrote my own. I've documented the configuration settings in IIS and NLB. The article provides the HTTP module code you need in order to implement a MaxKeepAliveRequests setting to make sure no client remains glued to the same node in the NLB cluster.

Connection balancing across NLB using IIS and MaxKeepAliveRequests

http://www.bigsoft.co.uk/blog/index.php/2011/09/21/connection-balancing-across-nlb-using-iis-and-maxkeepaliverequests

David Newcomb
  • 275
  • 1
  • 5
  • 14