Home > Windows Systems Management Tips > Web Management > When and how to use worker process recycling with IIS
WinComputing Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WEB MANAGEMENT

When and how to use worker process recycling with IIS


Brien M. Posey, Contributor
11.19.2007
Rating: --- (out of 5)


Expert advice on Windows-based systems and hardware
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Brien M. Posey
Web applications have long presented a special kind of problem for systems administrators. Often times, an application that works fine in a lab environment tends to be problematic in a production environment.

The reason why this is a problem for admins has to do with simple politics. The application developers often won't admit fault, because the application worked fine when they tested it. From their point of view, the administrator must have misconfigured the server that hosts the application.

From the systems administrator's standpoint, though, they are being asked to host an application that they know nothing about. The Web server itself is working fine prior to publishing the application, so any problems that occur later on must be related to the application.

More on working with IIS

How to use Trace Diagnostics 1.0 to troubleshoot IIS issues  

Working with IIS worker process isolation mode 

Configuring IIS 6.0 for FrontPage

In the years that I have been working with Internet Information Services (IIS), I have seen these types of situations develop into heated battles time and time again. Often, however, a little research reveals that the application works fine under a moderate workload. But when the server starts receiving an excessive number of requests, the application consumes more and more server resources until problems result.

In these types of situations, occasionally resetting an application can release the resources that the application has consumed, thus preventing the resource consumption from becoming problematic. Fortunately, you don't have to reset Web applications manually. You can configure IIS to recycle (reset) worker processes automatically.

When to use worker process recycling

I first want to point out that you shouldn't depend on this to act as a substitute for writing good code, nor should it be a substitute for fixing a buggy application. There are, however, a number of situations when you can -- and should -- implement worker process recycling.

Worker process recycling is a particularly effective technique in the following situations:

  • When a Web application contains a bug that cannot be fixed
  • When an application contains a memory leak
  • When service level agreements or corporate policies prevent you from fixing the buggy code
  • When you have yet to determine the source of the problem
  • The other thing you need to know is that worker processes are linked to application pools. This is important because if an application pool contains multiple Web applications, then recycling worker processes will effect each application in the pool.

    Configuring worker process recycling

    With that in mind, you can configure worker process recycling by opening the Internet Information Service Manager and navigating through the console tree to your server, application pool, then to the application pool that you need to modify. Next, right click on the application pool, and select the Properties command from the resulting shortcut menu. When you do, Windows will display the application pool's properties sheet, as shown in Figure A.

    Figure A

    As you can see in the figure, the majority of the options related to recycling worker processes can be found on the properties sheet's Recycling tab. This tab allows you to recycle worker processes at specific times or in specific time intervals. You also have the option of recycling worker processes after a specific number of requests or when the application pool has consumed a specific amount of memory (physical or virtual).

    Although this tab is the primary repository for settings related to worker process isolation, there are some important settings found on the other tabs. For example, if you look at Figure B, you can see that there is a setting that allows you to automatically shut down a worker process once it has been idle for a specific period of time. This allows you to terminate processes that have locked up or that are not being used because requests are not being made against the server.

    Note: By default, idle worker processes are shut down after 20 minutes of inactivity.
    Figure B

    The Health tab, shown in Figure C, allows you to define what it means for a worker process to be healthy. The first setting on this tab tells IIS to ping worker processes every 30 seconds (the time period is adjustable). If the worker process responds to the ping, then it is assumed to be functional.

    The next group of settings on this tab are related to rapid fail protection. Essentially, this means that you can tell IIS that if multiple processes fail within a certain length of time, then you should assume that something has gone horribly wrong and shut down the application pool. By default, five failures in five minutes will trigger an application pool shutdown.

    The final two settings found on the Health tab allow you to specify the maximum amount of time that a worker process can take to start up or to shut down.

    Figure C

    Remember, worker process recycling isn't a magical cure all for buggy applications, but in some instances, it can mean the difference between a production Web application doing its job -- or experiencing severe performance and stability problems.

    Brien M. Posey, MCSE, is a Microsoft Most Valuable Professional for his work with Windows 2000 Server, Exchange Server and IIS. He has served as CIO for a nationwide chain of hospitals and was once in charge of IT security for Fort Knox. He writes regularly for SearchWinComputing.com and other TechTarget sites.

    Rate this Tip
    To rate tips, you must be a member of SearchWinComputing.com.
    Register now to start rating these tips. Log in if you are already a member.


    Submit a Tip




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


    RELATED CONTENT
    Web Management
    Free HTML editor makes intranet updates a breeze
    Universal password tool gets update in SuperGenPass
    Fix app problems stemming from Firefox as default browser
    AddrView utility extracts all URLs from Web pages
    Control users' Internet access
    Raise Web server performance in Windows Server 2003
    Remotely administer IIS with HTML tool
    INDEX.DAT tool helps admins see what users browsed in IE
    Improving Internet browsing performance
    Check updates on a Web site

    Windows Server Monitoring and Administration
    Tips for Windows domain controller optimization
    Take control of server clusters with Microsoft's ClusDiag tool
    Analyze server history with new tool in Windows 2008
    Determining the cause of Windows server hang
    Preparing to troubleshoot a hung Windows server
    Why do Windows servers hang?
    Microsoft tool simplifies Windows server cluster configuration
    Exploring the Windows Server 2003 Resource Kit: Clusfileport.dll
    Exploring the Windows Server 2003 Resource Kit: Cmdhere.inf and CMGetCer.inf
    Avoid DC restoration problems with authoritative restore

    Microsoft Internet Information Services (IIS)
    How to use Microsoft's IIS Diagnostics Toolkit
    How to install the Microsoft IIS Diagnostics Toolkit
    How to use SSL Diagnostics 1.0 to identify issues in IIS
    How to use the IIS Diagnostics Toolkit's Log Parser 2.2. utility
    How to use the IIS Diagnostics Toolkit's WFetch 1.4 utility
    How to use SMTP Diagnostics 1.0 to troubleshoot IIS issues
    How to use AuthDiag 1.0 to troubleshoot IIS problems
    How to use Trace Diagnostics 1.0 to troubleshoot IIS issues
    How to use Debug Diagnostics to troubleshoot IIS issues
    Working with IIS worker process isolation mode

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

    HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




    All Rights Reserved, Copyright 2004 - 2008, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts