Currently Executing Requests Tracing

Applies To: Windows Server 2003, Windows Server 2003 with SP1

Use currently-executing requests tracing to find out which requests are executing in a worker process when the worker process has become slow or unresponsive. When enabled, currently-executing requests tracing prompts worker processes to report statistics and details about each request in each worker process. Currently-executing requests tracing is enabled via the command-line.

To understand how Request Monitor works, consider the following scenario:

You are the administrator for an e-commerce Web application. The Web application is hosted on IIS 6.0 running Microsoft Windows Server 2003 Service Pack 1.

Your developers make substantial changes to the application for a planned upgrade. While testing the upgraded application in a test environment, you notice in Task Manager that an IIS worker process (W3wp.exe) is periodically spiking to consume 100% of the CPU cycles on the server. You don’t know which requests are executing in the worker process or which URLs are being requested. In short, you have no idea where to begin searching for the source of this problem.

Previously, administrators in this situation could terminate the process in Task Manager and then check the HTTPERR log for clues as to what happened. Or, administrators may call Microsoft Product Support Services for assistance in attaching a debugger to the process to get a memory dump of the activity inside the worker process. This is not an ideal solution because of the time and expense involved in such a call.

With currently-executing requests tracing, you can narrow down the source of the problem by executing a command from a command prompt. For example, the administrator types the following command at a command prompt and then presses ENTER:

logman start W3wpTrace -p IIS: "Request Monitor" -ets

The administrator lets the trace session run for a few moments and then types the following at a command prompt and presses ENTER:

logman stop W3wpTrace -ets

Currently-executing requests tracing returns details about requests executing at the moment the command was executed. For example:

<WorkerProcessProcessID=3420
                    AppPoolId=DefaultAppPool
                    RequestsService=126
                    TotalWorkerThreads=4
                    AvailableWorkerThreads=4
                    ProcessUpTime=0:26:34
                                  >
<WebRequestList>
              <WebRequest ContextId={00000000-0000-0000-8f00-0060000000fe}
                     SiteId=1
LocalIPAddr=<data>
LocalPort=80
HostName=Contoso3
ConnectionID=1073741965
                     ProcessID=3420
ClientIP=<data>
Verb=Get
URL=/asp/asptest.asp
ProcessingState=processing
TimeElapsed=29723TimeFromLastState=29723

/>

      <WebRequestList>
             <WebRequest ContextId={00000000-0000-0000-2900-0060000000fb}
                     SiteId=1
LocalIPAddr=<data>
LocalPort=80
HostName=Contoso3
ConnectionID=1073741859
                     ProcessID=3420
ClientIP=<data>
Verb=Get
URL=/asp/asptest.asp
ProcessingState=processing
TimeElapsed=28281TimeFromLastState=28281
/>

</WebRequest>
</WebRequestList>
</WorkerProcess> 

With this information, the administrator determines there are two separate requests for asptest.asp, the processing state for each request is processing, and both of these requests have been processing for more than 28 seconds. With this information, the administrator can focus their troubleshooting efforts on the asptest.asp page. For example, the administrator could send the Request Monitor data to the developer of asptest.asp and ask the developer to look for code errors.

Note

If you expect Request Monitor to return hundreds of request details, you can filter the data output using other parameters.

For more information about tracing currently-executing requests with Request Monitor, including the step-by-step procedure for tracing requests and a detailed explanation of the command-line switches, see How to Trace All Requests Currently Executing in IIS Worker Processes.