How to modify Application Pool Recycling events in IIS 6.0 (332088)



The information in this article applies to:

  • Microsoft Internet Information Services version 6.0

This article was previously published under Q332088

SUMMARY

This step-by-step article describes how to set the flags that control the LogEventOnRecycle property in the Internet Information Services (IIS) 6.0 metabase.

The LogEventOnRecycle metabase property is a DWORD that has various bit flags for what type of recycling will generate an entry in the system event log. When you troubleshoot an ISAPI extension that implements the new server support function REPORT_UNHEALTHY, you may find it helpful to log an event for each instance that the ISAPI reports itself unhealthy.

Important This is a feature of application pools, and therefore applies only to worker process isolation mode.

back to the top

Enumerating the flags

Important This article contains information about editing the metabase. Before you edit the metabase, verify that you have a backup copy that you can restore if a problem occurs. For information about how to do this, see the "Configuration Backup/Restore" Help topic in Microsoft Management Console (MMC). You can enumerate Application Pools Recycling event flag settings by means of a script, such as the Adsutil.vbs utility.

To enumerate the properties and flags that are listed in the IIS metabase for Application Pools, and to view their current value, follow these steps:
  1. Open a command prompt: click Start, click Run, and then type
    cmd.
  2. Change to the directory where the Adsutil utility is located. The following is the default directory location: %SYSTEMROOT%\Inetpub\AdminScripts
  3. Type the following command:
    cscript adsutil.vbs enum w3svc/AppPools
back to the top

Explanation of flags

Metabase property

Description

AppPoolRecycleTimeLog event on Time-based recycles if set to true.
AppPoolRecycleRequestsLog event on number of Requests-based recycles if set to true.
AppPoolRecycleScheduleLog event on Schedule-based recycles if set to true.
AppPoolRecycleMemoryLog event on Memory-based recycle if set to true.
AppPoolRecycleIsapiUnhealthyLog event when worker processes request recycles because an ISAPI reported unhealthy if set to true.
AppPoolRecycleOnDemandLog event when an administrator requests a recycle of all processes in the application pool when set to true.
AppPoolRecycleConfigChangeLog an event if an Application Pool is recycled because one of the application pool properties that require a recycle to take effect has changed if set to true.
AppPoolRecyclePrivateMemoryLog an event if an Application Pool is recycled based on private memory when set to true .
back to the top

Setting the flags

You can set the flags by using Adsutil.vbs. To set the AppPoolRecyleMemory flag to false for the default Application Pool, follow these steps:
  1. Click Start, click Run, and then type cmd at the command prompt.
  2. Change to the directory where Adsutil is located. The following is the default directory location: %SYSTEMROOT%\Inetpub\AdminScripts
  3. Type the following command:

    cscript adsutil.vbs Set w3svc/AppPools/DefaultAppPool /AppPoolRecyleMemory false.

Note This command assumes that the LogEventOnRecycle property is enabled. If this command fails with the ErrNumber: -2147463164 (0x80005004), you must first enable the LogEventOnRecycle property. To enable the LogEventOnRecycle property, run one of the following commands:
  • To set all the values to FALSE, run the following command:

    cscript adsutil.vbs Set w3svc/AppPools/DefaultAppPool/LogEventOnRecycle 0

  • To set all the values to TRUE, run the following command:

    cscript adsutil.vbs Set w3svc/AppPools/DefaultAppPool/LogEventOnRecycle 255

Note Information about the metabase locations where you can configure the flags is in the documentation that is included with the product. For the same information online, visit the following TechNet Web site:back to the top

Event log entries

The following events appear in the Event log.
Flag set to TrueEvent generatedEvent ID
AppPoolRecycleTimeA worker process with process id "XXXX" serving application pool " AppPoolName" has requested a recycle because the worker process reached its allowable processing limit.1074
AppPoolRecycleRequestsA worker process with process id "XXXX" serving application pool " AppPoolName" has requested a recycle because it reached its request limit.1075
AppPoolRecycleScheduleA worker process with process id "XXXX" serving application pool " AppPoolName" has requested a recycle because it reached its scheduled recycle time.1076
AppPoolRecycleMemoryA worker process with process id "XXXX" serving application pool " AppPoolName" has requested a recycle because it reached its virtual memory limit.1077
AppPoolRecycleIsapiUnhealthyA worker process with process id "XXXX" serving application pool " AppPoolName" has requested a recycle because an ISAPI it loaded reported unhealthy and requested a recycle.1078
AppPoolRecycleOnDemandAn administrator has requested a recycle of all worker processes in application pool " AppPoolName".1079
AppPoolRecycleConfigChangeThe worker processes serving application pool " AppPoolName" are being recycled due to 1 or more configuration changes in the application pool properties which necessitate a restart of the processes. 1080
AppPoolRecyclePrivateMemoryA worker process with process id "XXXX" serving application pool " AppPoolName" has requested a recycle because it reached its private bytes memory limit.1177
back to the top

Troubleshooting

Information about the errors you may experience when setting these flags is in the documentation that is included with the product. For the same information online, see the following TechNet Web site: back to the top

REFERENCES

For more information about application pools, see the documentation at the following TechNet Web site:For more information about Recycling Worker Processes, see the documentation at the following TechNet Web site:back to the top

Modification Type:MajorLast Reviewed:3/3/2006
Keywords:kbHOWTOmaster kbpending kbprb KB332088 kbAudDeveloper