Article ID: 322350 - Last Review: November 21, 2006 - Revision: 7.1 How to recycle IIS 5.0 with the IIS 5.0 Process Recycling toolThis article was previously published under Q322350 On This PageSUMMARY This step-by-step article describes how to download and use
the Internet Information Services (IIS) 5.0 Process Recycling Tool
(IIS5Recycle) version 1.0, which was released in June 2001. IntroductionIIS5Recycle version 1.0 runs as a service on a computer that is running Microsoft Windows 2000 and IIS 5.0. The purpose of IIS5Recycle is to recycle processes, minimizing the effects of resource-consumption problems before performance and reliability are affected. This tool automatically recycles IIS processes based on configurations that are stored in the Windows registry. With IIS5Recycle, administrators can also gather information for use in troubleshooting processes and applications.The following example illustrates how IIS5Recycle can be used to recycle processes and to gather information: Minimizing consumption caused by memory leaks: A Web administrator suspects that Web applications that are running on the servers are leaking memory. The administrator schedules periodic recycling of IIS processes to release resources that are consumed by the leaking Web applications. The administrator can troubleshoot a Web application by using the Advanced Scripting feature. The administrator gathers and logs information about a problematic Web application before IIS is recycled. While the Web site continues to serve the customer, a developer can analyze the logs. Installation instructionsTo install IIS5Recycle:
Functionality and configurationWith IIS5Recycle, administrators can set criteria for the automatic recycling of IIS processes and stop IIS when recycling fails. The default interval between the time that the IIS5Recycle tools checks these values is either 15 minutes or what the QueryIISMinutes key is set to in the registry.Configure IIS5RecycleIIS5Recycle automatically recycles IIS processes based on the following criteria:
Stop IIS with IIS5RecycleIIS5Recycle forcefully stops IIS if a recycle request is unsuccessful after a configurable amount of time. This functionality makes sure that IIS is recycled when a recycle threshold is met. The registry key for this feature is IISStopTimeoutSecs.NoRealRecycle featureWith the NoRealRecycle feature, you can run the IIS5Recycle tool in an audit-only mode without interrupting the IIS service. When you use the audit-only mode, IIS recycling events are stored in the Windows event log and can be used to assess IIS recycling conditions that can be configured for your Web server. An administrator can use this feature to fine-tune the recycle settings based on application and environment specifics that are gathered during the audit-only mode run. To turn on this feature, add the following registry value:
Value name: NoRealRecycle To turn off this feature, set the NoRealRecycle key to 0 in the registry. Data type: REG_DWORD Value data: 1 Advanced Control/Scripting featureWith the Advanced Control/Scripting feature, administrators can specify commands (or scripts) to run before and after each IIS5Recycle execution.On the IIS5Recycle screen, click Advanced to open the Advanced Control window. In the resulting window, you can add commands to run before or after IIS is recycled, and you can also add a timeout value for these commands. The return value of the Before Command section is verified if the Verify Return Value check box is selected. The output of the script is redirected to a log file under %windir%\System32\Logfiles\Iis5recycle. If the script does not return the expected value, the current recycle is skipped. Note On a system that uses Windows Load Balancing Service (WLBS), the script is executed after WLBS stops and before WLBS starts. If you do not see the expected output in the log file, verify that the script name is correct and that it is copied to the %windir%\system32 directory. If the script must access any other executable files, make sure that all of those files are also located in the %windir%\system32 directory. NLB supportIIS5Recycle removes the Web server from the cluster (Web farm) on a system that is using Windows Network Load Balancing (NLB) before it recycles the IIS process. Each time a server is taken out of a cluster, connections to the Web server are drained. After the connection number drops below the configured threshold or the specified time passes, the IIS service is recycled. You can configure the default behavior of this feature by adding and setting the following registry keys:
The WaterMark feature guarantees that the number of servers in the cluster will always be more than the value that is set for WLBSWaterMark in the registry. There are two requirements to use the WaterMark feature:
RecoveryThe Service Control Manager (SCM), which is available through the Computer Management MMC snap-in, can be configured to take an action when a service fails unexpectedly. The IIS5Recycle service uses this feature as a fatal error notification and recovery method. When you configure the recovery actions for the IIS5Recycle service, the administrator is notified if an unrecoverable event occurs on the Web server. If any of the following failures occur, the IIS5Recycle service terminates itself to do the SCM recovery actions:
Appendix: Registry settingsWarning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk. All IIS5Recycle configuration settings are stored in the registry under the following key:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IIs5Recycle IIS5Recycle picks up all registry changes
automatically.You can configure the following entries by using the user interface in the IIS5Recycle Tool: Name: RunningHours Type: REG_DWORD Description: Recycles an IIS process every specified number of hours. Default: 24 * 7 (No Recycle) Name: RequestNumber Type: REG_DWORD Description: Recycles an IIS process every specified number of received HTTP requests. Default: 200,000 Requests Name: TimeSchedule Type: REG_SZ Description: Recycles an IIS process at certain times of a day. Default: Blank (No Recycle schedule) Name: MemoryUsage Type: REG_DWORD Description: Recycles an IIS process if it uses more than a specified amount of memory (in KB). Default: 1000000 KB Name: ASPRequestsQueued Type: REG_DWORD Description: Recycles an IIS process if the value of ASP requests queued is over this specified value in ASPThresholdRetries. Default: 2,000 Name: CustomScriptAfter Type: REG_SZ Description: Runs this script after the IIS process is recycled. Default: Blank Name: CustomScriptBefore Type: REG_SZ Description: Runs this script before the IIS process is recycled. Default: Blank Name: CustomScriptTimeout Type: REG_DWORD Description: The time that is permitted for the custom scripts to run before or after the IIS process is recycled. Default: 300 seconds The following are the names, types, and default values of the registry entries that IIS5Recycle uses. Note that you can only configure these settings by using the registry. You cannot configure these settings by using the user interface for the IIS5Recycle Tool. Note Your computer must be running Microsoft Windows 2000 Server with IIS 5.0 to add these registry entries. Name: QueryIISMinutes Type: REG_DWORD Description: Indicates how frequently processes query IIS status. Default: 15 minutes Name: RecycleIISDelayMinutes Type: REG_DWORD Description: Indicates how long to wait to see if IIS can reach a quiet time that is defined by QuietTimeRequests if a recycle condition is reached. Default: 0 minutes (recycle immediately) Name: QuietTimeRequests Type: REG_DWORD Description: Used to determine if IIS reached the quiet time. IIS tries to recycle processes at the next quiet time (if RecycleIISDelayMinutesequals zero) if a recycle condition is reached. Default: 10 GET requests/second Name: IISStopTimeOutSecs Type: REG_DWORD Description: Indicates the time specified for IIS to stop before a timeout occurs. Default: 60 seconds Name: IISStartTimeOutSecs Type: REG_DWORD Description: Indicates the time specified for IIS to start before a timeout occurs. Default: 60 seconds Name: NoRealRecycle Type: REG_DWORD Description: Reports a recycle event only. Default: 0 (do a recycle) Name: WLBSDrainWaitSecs Type: REG_DWORD Description: Indicates the time specified for a WLBS drain to stop. Default: 60 seconds Name: WLBSWaterMark Type: REG_DWORD Description: Indicates the number of current active hosts the NLB cluster must have to prevent IIS from skipping the current recycle period. IIS skips the recycle period if the number of current active hosts in the NLB cluster is equal to or below this threshold. Default: 0 (disabled) Name: WLBSDrainStopConnectionNum Type: REG_DWORD Description: Indicates the minimum number of current connections for IIS5Recycle to stop draining. IIS5Recycle stops draining if the number of current connections is below this value. Default: 0 (drain until there are no connections) Name: ForceDrainStop Type: REG_DWORD Description: Prevents NLB from being started by other monitoring programs during the WLBSDrainWaitSecs period. Default: 0 (disabled) Name: ASPThresholdRetries Type: REG_DWORD Description: Indicates how many times IIS5Recycle retries when the number of ASP requests queued is above the set value of ASPRequestsQueued. Default: 0 (no retries) To add these entries, follow these steps:
REFERENCES For more information, visit the following Microsoft TechNet
Web sites:
IIS 5.0 Process Recycling Tool The following file is available for download from the Microsoft Download Center: Collapse this image ![]() 119591
(http://support.microsoft.com/kb/119591/
)
How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most
current virus-detection software that was available on the date that the file
was posted. The file is stored on security-enhanced servers that help to
prevent any unauthorized changes to the file.
| Article Translations
|

Back to the top

