How to modify Application Pool Recycling events in IIS 6.0
This article was previously published under Q332088
IN THIS TASK
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 flagsImportant 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:
- Open a command prompt: click Start, click Run, and then type
- Change to the directory where the Adsutil utility is located. The following is the default directory location: %SYSTEMROOT%\Inetpub\AdminScripts
- Type the following command:
cscript adsutil.vbs enum w3svc/AppPools
Explanation of flags
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.
|AppPoolRecycleTime||Log event on Time-based recycles if set to true.|
|AppPoolRecycleRequests||Log event on number of Requests-based recycles if set to true.|
|AppPoolRecycleSchedule||Log event on Schedule-based recycles if set to true.|
|AppPoolRecycleMemory||Log event on Memory-based recycle if set to true.|
|AppPoolRecycleIsapiUnhealthy||Log event when worker processes request recycles because an ISAPI reported unhealthy if set to true.|
|AppPoolRecycleOnDemand||Log event when an administrator requests a recycle of all processes in the application pool when set to true.|
|AppPoolRecycleConfigChange||Log 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.|
|AppPoolRecyclePrivateMemory||Log an event if an Application Pool is recycled based on private memory when set to true .|
back to the top
Setting the flagsYou can set the flags by using Adsutil.vbs. To set the AppPoolRecycleMemory flag to false for the default Application Pool, follow these steps:
- Click Start, click Run, and then type cmd at the command prompt.
- Change to the directory where Adsutil is located. The following is the default directory location: %SYSTEMROOT%\Inetpub\AdminScripts
- Type the following command:cscript adsutil.vbs Set w3svc/AppPools/DefaultAppPool/AppPoolRecycleMemory false.
- 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
LogEventOnRecycleback to the top
Event log entriesThe following events appear in the Event log.
back to the top
|Flag set to True||Event generated||Event ID|
|AppPoolRecycleTime||A worker process with process id "XXXX" 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 "XXXX" serving application pool " AppPoolName" has requested a recycle because it reached its request limit.||1075|
|AppPoolRecycleSchedule||A worker process with process id "XXXX" serving application pool " AppPoolName" has requested a recycle because it reached its scheduled recycle time.||1076|
|AppPoolRecycleMemory||A worker process with process id "XXXX" serving application pool " AppPoolName" has requested a recycle because it reached its virtual memory limit.||1077|
|AppPoolRecycleIsapiUnhealthy||A 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|
|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 1 or more configuration changes in the application pool properties which necessitate a restart of the processes.||1080|
|AppPoolRecyclePrivateMemory||A worker process with process id "XXXX" serving application pool " AppPoolName" has requested a recycle because it reached its private bytes memory limit.||1177|
TroubleshootingInformation 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 propertiesback to the top
For more information about application pools, see the documentation at the following TechNet Web site:
How application pools work (IIS 6.0)For more information about recycling worker processes, see the documentation at the following TechNet Web site:
Recycling worker processes (IIS 6.0)back to the top
Article ID: 332088 - Last Review: 03/13/2008 20:22:55 - Revision: 10.1
Microsoft Internet Information Services 6.0
- kbhowtomaster kbpending kbprb KB332088