Microsoft KB Archive/332088

= How to modify Application Pool Recycling events in IIS 6.0 =

Article ID: 332088

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Internet Information Services 6.0

-



This article was previously published under Q332088



IN THIS TASK

 * SUMMARY
 * Enumerating the flags
 * Explanation of flags
 * Setting the flags
 * Event log entries
 * Troubleshooting
 * REFERENCES



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 &quot;Configuration Backup/Restore&quot; 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.
 * 1) Change to the directory where the Adsutil utility is located. The following is the default directory location:  \Inetpub\AdminScripts
 * 2) Type the following command:

cscript adsutil.vbs enum w3svc/AppPools

back to the top

Explanation of flags
{| 
 * width="50%"|

Metabase property

 * width="50%"|

Description

 * 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.
 * }
 * 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.
 * }
 * Log 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.

back to the top

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:  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: \Inetpub\AdminScripts 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

</ul>

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

back to the top

Event log entries
The following events appear in the Event log.

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, visit the following TechNet Web site:

Code examples to configure Metabase properties

http://technet2.microsoft.com/windowsserver/en/technologies/featured/iis/default.mspx

back to the top

<div class="references_section">