title: Client disconnect hangs IIS application pool
body: <p>I have several .NET 3.5 sites running the same code base on a Windows 2008 R2 64 bit IIS 7.5 web server.  We are having trouble with a process that allows the user to manage their own files on the server (upload, download, delete).  Before we moved the sites from an older server running IIS 6 on Windows 2003 we never had any problems with this feature.  After the move we had three different sites completely lock up and stop executing requests.  I had to restart the application pool and website to get them running again.  We changed the application pools to run in classic mode and that did stop the sites from crashing.</p>
  
  <p>In analyzing the site history we found that there were groups of twenty to thirty people (a class) uploading multiple files (.5 to 2 megs each) within about a 10 minute period.  So we chased the problem down to this file management feature and decided to move the data store onto a local drive.  We continued to get errors on the machine that described the users leaving these pages before the work was completed so I added tests for Response.IsClientConnected.  This all seemed to be helping but the errors continued.  We installed an application (IIS Peek) to monitor the activity and report back on long running requests.  I set the execution timeout to five minutes and then had IIS Peek monitor for any requests that took longer.  We continually get multiple errors through the day on pdf and flash files but they eventually clear up.  So when we were getting errors from the file management feature we were unable to manage files at all (the page would just time out).  I decided to try using an AsyncPage solution and this seemed to resolve the problem of the file management just locking up.  However we still continue to have problems.  The errors we get on the file upload pages tend to hang around for an hour or more and when the problem exists file uploads take considerably longer to complete even with the AsyncPage solution.  Yesterday, during one of these episodes, I wasn't able to get a file to upload at all.  I was able to delete a file.  So although we have fewer issues, we are still having problems with the file management feature.</p>
  
  <p>Here are the two different errors we've gotten related to the users disconnecting before the response is sent.</p>
  
  <p>Exception message: An error occurred while communicating with the remote host. The error code is 0x800704CD. </p>
  
  <p>Exception message: An error occurred while communicating with the remote host. The error code is 0x80070057.</p>