Partager via


Enabling CPU Monitoring

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

By using CPU monitoring, you can monitor worker processes for CPU usage and optionally shut down the worker processes that consume large amounts of CPU time. CPU monitoring is only available in worker process isolation mode.

To configure CPU monitoring for individual application pools, choose between two monitoring options: error event logging or the shutdown of all worker processes in the application pool that is consuming more CPU time than the specified limit.

Event logging

When the CPU usage for a specific application pool reaches a set limit, the WWW service writes an error to the Windows Server 2003 system log, which can be viewed in Event Viewer. The entry includes the worker process identifier and the name of the application pool that exceeded the CPU limit.

To view the event log, open Control Panel and access Event Viewer through Administrative Tools. Then double-click the system event log.

Shut down the unhealthy application pool (also includes event logging)

When you choose this option, IIS logs an error in the system log and shuts down all worker processes in the application pool. After the application pool shuts down, HTTP.sys returns an out-of-service message (503: Service Unavailable) for any request that is received during the interval when the application pool is stopped. The application pool remains shut down until the CPU reset interval (set by the CPUResetInterval metabase property) elapses. IIS then restarts the application pool, and CPU monitoring starts over again.

Obtaining more detailed CPU monitoring

If your Web server is running Windows Server 2003, Enterprise Edition or Windows Server 2003, Datacenter Edition, you can use Windows System Resource Manager to obtain more detailed CPU monitoring. Using Windows System Resource Manager, you can control how CPU resources are allocated to applications, services, and processes. For more information, see Windows System Resource Manager Frequently Asked Questions.

Enabling CPU Monitoring

You can enable CPU monitoring by using either IIS Manager or from the command line.

Enabling CPU monitoring from the command line can take as many as three steps:

  • Set the CPULimit metabase property, which limits the worker processes in a specified application pool to a percentage of CPU time.

  • Set the CPUResetInterval metabase property, which specifies the time interval for CPU monitoring.

  • Set the CPUAction metabase property, which specifies the type of action you want IIS to take, such as write to the event log or shut down worker processes that exceed the CPU limit. Table 3.7 lists the possible values for CPUAction. Use only one value from the table for each application pool. If you do not set the CPUAction metabase property, IIS assigns the default value, which is zero (event logging only).

Table 3.7   Values for the CPUAction metabase property

Value Description

0

Writes a warning to the system log in Event Viewer when the worker processes for the application pool exceed the CPU limit, but takes no other action.

1

Writes a warning to the system log, and shuts down worker processes in the application pool, when the worker processes exceed the CPU limit.

For more information about enabling CPU monitoring by using IIS Manager and from the command line, see Enabling CPU Monitoring in IIS 6.0.