Solved

IIS 6.0 on Win2k3 disconnects client's (IE in my case) POST request

Posted on 2003-12-09
5
3,277 Views
Last Modified: 2012-08-13
IIS 6.0 on Win2k3 disconnects client's (IE in my case) POST request if the processing asp is running some time consuming task and it hasn't written anything in Response object. For example

<%@ Language=VBScript %>
<%option explicit%>
<%
      Server.ScriptTimeout = 3600
      Response.Buffer = false
%>
<%
      nSleepTime = 70

      if (Request("Text1") = "10") then
            Call SomeLongRunningTask()
      end if

      Response.Write "Complete."
%>
<HTML>
<HEAD>
</HEAD>

<BODY>

<form name="frmMyForm" method="post" action="Test.asp">
      <input type="Text" name="Text1" value="12">
      <input type="Text" name="Text2" value="20">
      <input type="submit" name="SubmitButton" value="Submit Form">
</form>

</BODY>

</HTML>

This happens only if the request is a POST. GET request continues running however long it takes. The time it terminates the request is slightly larger than Connection Timeout given in IIS 6.0 (default value 120 secs). Please note that same code works in IIS 5.0 on Win2k without any problem. The Connection Timeout value in IIS 5.0 is 900 sec but I have changed it to 120 secs and IIS 5.0 never disconnects the client POST request.

IIS 6.0 doesn't disconnect the request if asp has written something before starting the long running task. For example if I change the code to ...

      if (Request("Text1") = "10") then
                                Call Response.Write("<!-- Some Dummy Output -->")
            Call SomeLongRunningTask()
      end if

it works with IIS 6.0

Could this be a bug in IIS 6.0 or a desired behavior? If it is a desired behavior then why it happens only for POST and not for GET?
0
Comment
Question by:amit_g
  • 2
5 Comments
 

Expert Comment

by:belthasar
ID: 9908250
Your application pool might be getting overloaded. There are 2 things you could try. Go into the properties of the application pool and click on the performance tab. Increase the web garden value from the default 1 to 2 or 3. Also go to the health tab and turn off or increase the threshold for rapid fail protection. Hope this helps. :)
0
 
LVL 58

Author Comment

by:amit_g
ID: 9908325
This is not a load issue. I have only one request on the server when I am testing. Also the worker process is neither killed nor recycled. The IIS simply disconnects the socket after 140-180 seconds even though the asp is still processing. This is also verified by looking into COM+ application if the long running process is a COM application. The COM application continues working. I have made the long running process by having a COM that sleeps. I also have tested it with a long running asp while loop. Either way the socket is disconnected by IIS 6.0.

The connection timeout property is there so that IIS disconnects inactive clients and it is used along with HTTP Keep-Alives property. For some reason IIS 6.0 is treating this request as inactive. This happens only if the request is a POST request. It doesn't happen if the request is GET.

I can fix it by increasing the Connection Timeout but there are only few pages that takes long time to process a request and just for those I don't want to increase the Timeout for the whole site. I can also fix it by putting something in response before starting the long running process but that is a unnecessary code change. Basically an application working perfectly and smoothly for so long on Win2k doesn't work on Win2k3 server. What I am asking here is if someone else has seen this happening or if someone can find a MS support article explaining it.
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9909769
Hmmm.... could be another one of those undocumented IIS 6  security features... I had a tough time with the upload size limit restriction setting. Finally read about it in some news group. If i remember correctly, i had to modify the web.config (or config.web) file to rectify that. Try something on those lines...

Also, I am sure you are aware of this issue with IE 6...
http://www.iisfaq.com/?View=A508&P=1

Cheers!!
0
 
LVL 58

Accepted Solution

by:
amit_g earned 0 total points
ID: 10221573
I posted the same question in MS newsgroups and a guy from MS acknowledged that there was a bug in the HTTP.SYS ...

>>      Ok, I dug around this some more, and I found that there was a bug in
>>      HTTP.SYS for WS03 RTM where the Timer for request entity (presumably for
>>      POST requests...) was not being turned off in certain conditions and would
>>      cause a timeout of the response (things that hit this are either large
>>      downloads or long-running serverside operations resulting from POST
>>      requests).  That sounds like exactly your situation.
>>
>>      It has been fixed and will be released in the next WS03 SP. Best current
>>      workaround is to use GET, which won't have such a timer since there's no
>>      entity body involved.
>>      --
>>      //David
>>      IIS
>>      This posting is provided "AS IS" with no warranties, and confers no rights.
>>      //

The workaround I used is to write something (<!-- For IIS 6.0 -->) in the response and use Response.Buffer = False.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now