title: Debugging requests which are 'stuck' in an IIS worker process
body: <p><strong><em>In case of TL;DR - I basically need guidance regarding what tools are available to debug requests which are issued to IIS and which stall inside a module.</em></strong></p>
  
  <p>I have a problem with an old ASP 2.0 app at the moment whereby it will periodically become unavailable and recycling the app pool (horrible as that may be) doesn't bring it back up 100% of the time.</p>
  
  <p>So first of all it presents itself as requests entering the app pool and being trapped in state 'BeginRequest' in RewriteModule.</p>
  
  <p>It is not a specific request which is always the first to experience this issue. The issue cannot be easily recreated either.</p>
  
  <p>Eventually requests join this backlog and when it becomes 70+ deep the app pool fails to respond to pings from WAS and it forcibly recycles. Predictably it doesn't stop on-time and the old app pool is forced to stop. When the new app pool comes up it either works just fine or it instantly experiences the same issue as the outgoing one and requests begin to queue.</p>
  
  <p>In issues like this all the official guidance is understandably focussed around looking at why the RewriteModule may choke. </p>
  
  <ul>
  <li><p>I have validated my redirections and though complex there are no obvious issues with syntax (XML validates).</p>
  
  <ul>
  <li><p>Likewise in inetmgr loading up the URL Rewrite Module seems to parse the configs fine and show them visually.</p></li>
  <li><p>Basic stuff like permissions is all fine.</p></li>
  </ul></li>
  </ul>
  
  <p>When the app is working normally I also used Failed Request Tracing/Logging to look at the request pipeline for a sample URL which stalled and I can confirm that there is no circular logic or weird errors presenting - the request seems to be handled just fine. This also showed me how high up the rewritemodule is invoked and from this I really don't see how the issue could be app-related as .NET isn't invoked at this point.</p>
  
  <p>Annoyingly when an app pool is experiencing this issue and I can throw in requests which just stall Failed Request Tracing is no good because you actually need a request to get to the end of it's journey and fail otherwise it refuses to log anything out.</p>
  
  <p>I resorted to taking process dumps of affected w3wp.exe's and running them through DebugDiag. Unfortunately the only thing I see is that threads are open accessing the rewritemodule but precious little about what they are stuck on.</p>
  
  <p>As anyone else would do I've tried to track the start of the issue back to any recently installed patches or code changes but nothing matches. Likewise this is happening on 3x servers otherwise I would try reinstalling the rewritemodule. Other sites on the same server which invoke rewritemodule are unaffected.</p>
  
  <p>Has anyone else experienced issues like this - the net seems to have relatively little info in this case. Perhaps you can recommend further debugging tools or approaches for IIS which I can adapt to this scenario? This is sort of a cry for help from someone more used to Apache/Nginx - sorry for the long post.</p>