Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2003-12-09
5
Medium Priority
?
3,341 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

704 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