Share via


Logging Worker Process Recycling Events in IIS 6.0

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

By default, IIS does not log worker process recycling events. You can, however, enable logging of the worker process recycling events that you specify. Unlike other IIS activity, which is logged in a location and file that you specify, worker process recycling events are written to the system event log.

Logging worker process recycling events can help you with troubleshooting IIS. For example, when troubleshooting an ISAPI extension that implements the new server support function REPORT_UNHEALTHY, you can specify that IIS logs an event for each instance that the ISAPI reports itself unhealthy.

The following table describes the worker process recycling events for which you can enable logging. To enable logging for an event, set the corresponding metabase property to true.

Metabase Property Description

AppPoolRecycleTime

Logs event on time-based recycles.

AppPoolRecycleRequests

Logs event on number of request-based recycles.

AppPoolRecycleSchedule

Logs event on schedule-based recycless.

AppPoolRecycleMemory

Logs event on memory-based recycle.

AppPoolRecycleIsapiUnhealthy

Logs event when worker processes request recycles because an ISAPI reported unhealthy.

AppPoolRecycleOnDemand

Logs event when an administrator requests a recycle of all processes in the application pool.

AppPoolRecycleConfigChange

Logs an event if an application pool is recycled because one of the application pool properties that requires a recycle to take effect has changed.

AppPoolRecyclePrivateMemory

Logs an event if an application pool is recycled based on private memory.

Important

You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /User:MyComputer\Administrator cmd to open a command window with administrator rights and then type cscript.exe ScriptName (include the script's full path and any parameters).

Procedures

To enable logging of worker process recycling

  1. From the Start menu, click Run.

  2. In the Open box, type cmd, and then click OK.

  3. At the command prompt, type the following and then press ENTER: cd %systemroot%\inetpub\adminscripts

  4. At the command prompt, type the following and then press ENTER: **cscript adsutil.vbs set w3svc/AppPools/**AppPoolName/EventName true

    Replace AppPoolName with the name of the application pool and EventName with the name of the event for which you want to enable logging. For example, the following command enables logging of memory-based recycling events for the default AppPool: cscript adsutil.vbs set w3svc/AppPools/DefaultAppPool/AppPoolRecycleMemory true

Note

To disable logging of worker process recycling events, end the command-line with false.

The following table shows an example system event log entry along with the event ID for each type of recycling event.

Recycling Event Log Entry Generated Event ID

AppPoolRecycleTime

A worker process with process ID IDNumber serving application pool AppPoolName has requested a recycle because the worker process reached its allowable processing limit.

1074

AppPoolRecycleRequests

A worker process with process ID IDNumber serving application pool AppPoolName has requested a recycle because it reached its request limit.

1075

AppPoolRecycleSchedule

A worker process with process ID IDNumber serving application pool AppPoolName has requested a recycle because it reached its scheduled recycle time.

1076

AppPoolRecycleMemory

A worker process with process ID IDNumber serving application pool AppPoolName has requested a recycle because it reached its virtual memory limit.

1077

AppPoolRecycleIsapiUnhealthy

A worker process with process ID IDNumber serving application pool AppPoolName has requested a recycle because an ISAPI it loaded reported unhealthy and requested a recycle.

1078

AppPoolRecycleOnDemand

An administrator has requested a recycle of all worker processes in application pool AppPoolName.

1079

AppPoolRecycleConfigChange

The worker processes serving application pool AppPoolName are being recycled due to one or more configuration changes in the application pool properties which necessitate a restart of the processes.

1080

AppPoolRecyclePrivateMemory

A worker process with process ID IDNumber serving application pool AppPoolName has requested a recycle because it reached its private bytes memory limit.

1177

  • For information about setting the LogEventOnRecycle metabase property, see LogEventOnRecycle Metabase Property.

  • For information about viewing the system event log, see "Event Viewer" in Help and Support Center for Windows Server 2003.