ASP.NET site sometimes freezing up and/or showing odd text at top of the page while loading, on load balanced servers

MGOwen I will share my experience for a similar problem that I was have.

Some time ago I have a similar problem, the pages work well, except some pages that after compress them with gZipped they have problems and not working correctly, something like yours.

I discover that the problem was because I set the Content-Length on header, and then for some reason when was going to be gZipped the Content-Length, didn't change / or was calculate false, and the result was a similar error like yours.

So check if you set the Content-Length in a way on your pages, and then use gZip filter. If yes then remove the Content-Length setting in your program.

In general speaking I say that the length have the problem on your page, and the lenght is a variable in Content-Length.

-and in your header the Content-Length exist !-

update
Also one other think that I notice, if your page send as gZip where is that in your head ? if this is the full head of your page.


The text you are seeing is the page header. I'm guessing both it and the xml parsing error are being caused by the output to the browser being cut off or, even more bizarrely, only a chunk from the response being relayed.

I'd start with the load balancer and see if there are any logs available. After that, I'd try disabling the IIS compression that Aristos mentioned and see if that has an affect (in IIS get properties on the "Web Sites" folder and then go to the Service tab or find out if compression was enabled / changed for that particular site).

After that, you'll probably have to resort to some kind of packet sniffer to see what is actually being sent on either side of the balancer.


are the machines sharing the same machine key?
This along with accessing Session state could cause strange errors.