Generate dump files for diagnosisIIS 6.0 has a new feature that is named Orphan Worker Process. This feature lets you inspect a process that is scheduled to be recycled before the process is terminated. The Orphan Worker Process can be used to attach a debugger to the process and to generate a dump file for investigation.
Note This feature is not enabled when processes run in IIS 5.0 compatibility mode.
Download Debugging Tools for WindowsTo download Debugging Tools for Windows, visit one of the following Microsoft Web sites, as appropriate for your situation:
Windows 32-bit version:Note When you install Debugging Tools for Windows, make sure that you save the files to the following directory:
Create a batch file to execute when a worker process is orphaned
- Start Notepad
- Paste the following code into Notepad.
@if "%_echo%"=="" echo off
set TIMESTAMP=%TIMESTAMP: =_%
set COMMAND=c:\debuggers\cdb.exe -c ".dump /o /ma %FILENAME%;q" -p %1
echo %COMMAND% > %LOG%
- Save the file as
FileName.cmd. For this example, we will name the file Action.cmd. However, you may name the file as you want.
Configure the Orphan Worker Process settings
- At the command prompt, type the following command, and then press ENTER:cd \Inetpub\adminscripts
- To enable the Orphan Worker Process feature, type the following command at the command prompt:
adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanWorkerProcess TRUE
- At the command prompt, set the executable to run when a process is scheduled to be recycled. For example, in this case use the batch file that was created in the "Create a Batch File to Execute When a Worker Process Is Orphaned" section:
adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanActionExe "c:\action.cmd"
adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanActionParams "%1%"
Note If you enable IIS to debug worker processes that are reported as unhealthy, make sure that you monitor these released worker processes. IIS does not automatically remove these worker processes from memory. If you do not correctly handle these worker processes, many failed worker processes may be running on your computer. These worker processes can tie up resources that are needed by other processes. You must end these worker processes quickly to free those resources. In some conditions, these worker processes may block metabase access. This causes problems with other worker processes or with the World Wide Web service itself.
รหัสบทความ: 828222 - การตรวจสอบครั้งสุดท้าย: 21 ต.ค. 2009 - ฉบับแก้ไข: 1