How to modify Application Pool Recycling events in IIS 6.0

Article translations Article translations
Article ID: 332088 - View products that this article applies to.
This article was previously published under Q332088
Expand all | Collapse all

On This Page

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.

Enumerating the flags

Important This article contains information about how to edit 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

Explanation of flags

Collapse this tableExpand this table

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 .
Important The metabase property IdleTimeout does not have an associated LogEventOnRecycle property flag. Therefore, when an application pool is shut down because the IdleTimeout value is reached, an Event log entry will not be logged.

Setting the flags

You can set the flags by using Adsutil.vbs. To set the AppPoolRecycleMemory 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/AppPoolRecycleMemory 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:
LogEventOnRecycle
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/6f43da84-38b0-422b-aa2b-195643d05d22.mspx

Event log entries

The following events appear in the Event log.
Collapse this tableExpand this table
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

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, visit the following TechNet Web site:
Code examples to configure Metabase properties
http://technet2.microsoft.com/windowsserver/en/technologies/featured/iis/default.mspx

REFERENCES

For more information about application pools, see the documentation at the following TechNet Web site:
How application pools work (IIS 6.0)
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/67e39bd8-317e-4cf6-b675-6431d4425248.mspx
For more information about recycling worker processes, see the documentation at the following TechNet Web site:
Recycling worker processes (IIS 6.0)
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/1652e79e-21f9-4e89-bc4b-c13f894a0cfe.mspx

Properties

Article ID: 332088 - Last Review: March 13, 2008 - Revision: 10.1
APPLIES TO
  • Microsoft Internet Information Services 6.0
Keywords: 
kbhowtomaster kbpending kbprb KB332088

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com