Iis – Load Balanceing IIS Server Is Always Sticky for 60 seconds

apache-2.2haproxyiisload balancing

I have a load balancer setup with two server farms behind it, one has 3 Apache servers on Linux and the other has 2 IIS servers. I configured 2 virtual services on the load balancer identically, one pointing to each farm and set to do round robin balancing with no persistence. The Apache servers work just as expected, but the IIS servers stick the session for 60 seconds before sending the next request to the next server.

To demonstrate this I simply created an HTML page that shows the server name. When I go to the virtual address presented by the load balancer, I see server 1, 2, 3, 1, 2, 3, etc when I press refresh on the Apache servers. However when I go to the virtual address pointing to the IIS servers when I press refresh I am still on the same server. If I wait 60 seconds then refresh I am directed to the other IIS server.

The current load balancer that I am using is from Kemp Technologies. However, before I setup the Kemp I saw the exact same behavior when using HAproxy. Therefore this seems to be a Windows issue on the back end server somehow, instead of the load balancer. However I don't really understand how this is possible since it should be the load balancer determining which backend server will service the request.

Has anyone else seen this type of behavior? Is there something that I can modify to allow my Windows servers to be balanced in a true round robin fashion?

EDIT —

The test pages on the IIS systems run a server side ASP script to insert the current date/time with a simple ASP script <%=now()%>. This allows me to see that the pages are not being cached and are being dynamically regenerated on each request. These pages also contain the IIS host name so I can tell which IIS server actually generated the rendered page.

Best Answer

Yeah, your intuition is right -- it's really not possible for IIS to be causing this issue, as those devices have no control over where the requests get routed.

Are you certain that your browser isn't simply caching the page, with the next request going to the other server properly and getting a 304 (not modified) response?

In other words - are you using a method other than what your browser displays to verify where the requests are going?