Partager via


Configuring Startup and Shutdown Time Limits

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

When the World Wide Web Publishing Service (WWW service) detects that a worker process is unhealthy, it marks the worker process for termination, and then, within configured time limits, it terminates the worker process and starts a new worker process to replace it. Worker processes shut down gracefully (finish request processing) when the shutdown time period is long enough to allow for this. It is important to tune the shutdown time period to fit the load characteristics of the applications that are being processed.

Procedures

Important

You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /user:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".

To configure a new worker process to start up within a specified time by using IIS Manager

  1. In IIS Manager, expand the local computer, expand Application Pools, right-click the application pool, and click Properties.

  2. Click the Health tab, and under Startup time limit, in the box next to Worker process must startup within (time in seconds), type the desired number of seconds.

  3. Click OK.

To configure a worker process to shut down within a specified time by using IIS Manager

  1. In IIS Manager, expand the local computer, expand Application Pools, right-click the application pool, and click Properties.

  2. Click the Health tab, and under Shutdown time limit, in the box next to Worker process must shutdown within (time in seconds), type the desired number of seconds.

  3. Click OK.

Optionally, you can configure shutdown and startup time limits by setting the StartupTimeLimit or ShutdownTimeLimit metabase properties.

To set a worker process to shut down or start up within a specified time by using Adsutil.vbs

  1. In the Run dialog box, type cmd, and then click OK.

    • To set a shutdown time limit, at the command prompt, type:

      cscript %SystemDrive%\Inetpub\AdminScripts\adsutil.vbs set W3SVC/AppPools/ApplicationPoolName/ShutdownTimeLimit n

    • To set a startup time limit, at the command prompt, type:

      cscript %SystemDrive%\Inetpub\AdminScripts\adsutil.vbs set W3SVC/AppPools/ApplicationPoolName/StartupTimeLimit n

      Replace n with the number of seconds that you want to elapse before shutting down or starting the worker process.

For more information about setting startup and shutdown times for the worker processes, see StartupTimeLimit Metabase Property and ShutdownTimeLimit Metabase Property.