Configuring Worker Process Recycling


Manual recycling of worker processes might work when you’re troubleshooting, but on a day-to-day basis you probably don’t have time to monitor worker process resource usage and responsiveness. To have IIS handle worker process recycling for you, you’ll want to configure some type of automatic worker process recycling. Automatic worker process recycling can be configured to occur:

  • After a specific time period Recycles worker processes based on the amount of time they’ve been running. Best used when applications have known problems running for extended periods of time.

  • When a certain number of requests are processed Recycles worker processes based on the number of requests processed. Best used when applications fail based on usage.

  • At specific scheduled times during the day Recycles worker processes based on a defined schedule. Best used when applications have known problems running for extended periods of time and you don’t want processes to be recycled during a peak usage period. Here, you’d schedule recycling when you expect application usage to be at its lows for the day.

  • When memory usage grows to a specific point Recycles worker processes when they use a certain amount of virtual (paged) or physical (nonpaged) memory. Best used when applications have known or suspected memory leaks.

  • When requested by the application Recycles worker processes based on requests from applications. ISAPI extension applications can be coded to declare themselves unhealthy using the server support function HSE_REQ_REPORT_UNHEALTHY.

The sections that follow discuss techniques for configuring automatic worker process recycling. When you configure recycling, keep in mind that active worker processes continue to run while IIS starts new worker processes to replace them. Once the new worker processes are started, Http.sys directs incoming requests to the new worker processes and the old worker processes are able to continue handling requests until they shut down. The startup and shutdown processes can be limited by the Startup Time Limit and Shutdown Time Limit values set for the application pool. If these values are set inappropriately, new worker processes might not start and old worker processes might shut down before they’ve finished processing current requests.

Recycling Automatically by Time and Number of Requests

When applications have known problems running for extended periods of time and handling requests in peak loads, you probably want to configure automatic recycling by time, by number of requests, or both. To configure automatic recycling by time and number of requests, follow these steps:

  1. In the IIS snap-in, expand Application Pools, right-click the application pool that you want to configure, and then select Properties. The Recycling tab should be selected by default, as shown in Figure 6-5.

    click to expand
    Figure 6-5: Worker processes can be recycled automatically based on time, number of requests, and memory usage.

  2. To recycle worker processes after a specified period of time, select Recycle Worker Processes (In Minutes) and then type the number of minutes that you want to elapse before worker processes are recycled.

    Tip

    In most cases it’s prudent to schedule worker process recycling to take place at specific off-peak usage times rather than to set hard limits based on runtime or number of requests handled. If you schedule recycling, you control when recycling occurs and can be reasonably sure that it won’t occur when the application usage is high.

  3. To recycle a worker process after processing a specified number of requests, select Recycle Worker Processes (Number Of Requests) and then type the number of requests that you want to be processed before the worker process is recycled.

  4. To recycle worker processes according to a specific schedule, select Recycle Worker Processes At The Following Times. You now have the following options:

    • Add a scheduled recycle time Click Add. Use the Select Time dialog box to set the recycle time on a 24-hour clock. Select the hours or minutes and then use the up and down arrows to set the time. Click OK.

    • Edit a scheduled recycle time Click the recycle time you want to change and then click Edit. Change the recycle time using the Select Time dialog box and then click OK.

    • Remove a scheduled recycle time Click the recycle time you want to delete and then click Remove.

  5. Click OK to apply the settings.

Recycling Automatically by Memory Usage

When applications have known or suspected memory leaks, you probably want to configure automatic recycling based on virtual or physical memory usage. To configure automatic recycling of worker processes based on memory usage, follow these steps:

  1. In the IIS snap-in, expand Application Pools, right-click the application pool that you want to configure, and then select Properties. The Recycling tab should be selected by default, as shown previously in Figure 6-5.

  2. Virtual memory usage refers to the amount of paged memory written to disk that the worker process uses. To limit virtual memory usage and automatically recycle a worker process when this limit is reached, select Maximum Virtual Memory (In Megabytes) and then type the virtual memory limit in the field provided.

    Tip

    In most cases you’ll want to establish the baseline virtual and physical memory usage for an application before configuring memory recycling. If you don’t do this, you might find that worker processes are being recycled at the most inopportune times, such as when the server is experiencing peak usage loads. A good rule of thumb is to allow physical memory usage of at least 1.5 times the baseline usage you see and to allow virtual memory usage of at least 2 times the physical memory usage. For example, if your baseline memory usage monitoring shows that the application typically uses 128 MB of physical memory and 96 MB of virtual memory, you might allow memory usage up to at least 192 MB for physical memory and 256 MB for virtual memory.

  3. Physical memory usage refers to the amount of RAM that the worker process uses. To limit physical memory usage and automatically recycle a worker process when this limit is reached, select Maximum Used Memory (In Megabytes) and then type the memory limit in the field provided.

  4. Click OK to apply the settings.




Microsoft IIS 6.0Administrator's Consultant
Microsoft IIS 6.0Administrator's Consultant
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 116

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net