I have an Azure web role with two instances. Both instances are “ready” – running okay.
On my desktop I have four instances of the same program running simultaneously and hitting the web role URL with HTTP requests. Yet according to the logs all requests are dispatched to instance 0 only. I need requests to be dispatched to both instances to test concurrent operation.
Why are requests not dispatched to the second instance and how do I make them dispatched there?
Looks like this behavior is due to IIS “keep alive” (
<system.webServer><httpProtocol allowKeepAlive="true">. Because of “keep alive” once a client has been served by an instance it gets stuck with that instance.Disabling “keep alive” removes that and requests now get to all instances more or less randomly. MSDN says disabling “keep alive” may reduce performance but for the sake of testing concurrent operation it would be okay.