Saturday, February 22, 2014

IIS Web Garden / Client Affinity / Scaling

I actually found this the hard way, but I needed to use a service that could not be fully multi-threaded (due to some COM issues) and therefore the only good way to scale it was using web garden. This worked well, but I noticed the distribution of requests across the processes was not ideal. Looking more into it I found that there is some sort of client affinity going on and that for the same client connection it may go always to the same server process.

Resource Monitor allowed me find the root of the problem by looking at the TCP connections. I can see that although I make 50 connections, there are only about 7 connections to the server. The reason was that the server was using HTTP keep alive and re-using the connections. So to avoid this affinity, I found out an easy way to turn off keep live to the server by using a custom binding. Press here for more information...

No comments: