Monitoring Processes

Microsoft® Windows® 2000 Scripting Guide

Monitoring processes on a regular basis helps you ensure that a computer runs at peak efficiency and that it carries out its appointed tasks as expected. For example, by monitoring processes you can be notified immediately of any application that has stopped responding, and then take steps to end that process. In addition, process monitoring enables you to identify problems before they occur. For example, by repeatedly checking the amount of memory used by a process, you can identify a memory leak. You can then stop the process before the errant application uses all of the available memory and brings the computer to a halt.

Process monitoring also helps minimize the disruptions caused by planned outages for upgrades and maintenance. For example, by checking the status of a database application running on client computers, you can determine the impact of taking the database offline in order to upgrade the software.

Process monitoring can be divided into three general categories:

  • Monitoring process availability. Measures the percentage of time that a process is available.

    Availability is typically monitored by use of a simple probe, which reports whether the process is still running. By keeping track of the results of each probe, you can calculate the availability of the process. For example, a process that is probed 100 times and responds on 95 of those occasions has an availability of 95 percent.

    This type of monitoring is typically reserved for databases, mail programs, and other applications that are expected to run at all times. It is not appropriate for word processing programs, spreadsheets, or other applications that are routinely started and stopped several times a day.

  • Monitoring process reliability. Measures how frequently a process fails, and the amount of time required to restart a failed process.

    Reliability is calculated by dividing the time the process is functioning by the total number of days in a year. For example, a process that experiences a total downtime of 2 days during the course of a year is 99.5 percent reliable (363 days of availability divided by 365 days in a year).

    This type of monitoring is also reserved for databases, mail programs, and other applications that are expected to run at all times. It is not appropriate to measure reliability for word processing programs, spreadsheets, or other applications that are routinely started and stopped several times a day.

  • Monitoring process performance. Measures whether the process runs in the expected manner.

    Performance monitoring is typically done by tracking memory use and threads. In general, a process should show a pattern of being allocated additional memory as needed and then releasing that memory when it is no longer needed. Likewise, a process should continually be creating and destroying threads. If memory is allocated but not released, or threads are created but not destroyed, this is usually an indication of a memory leak or another problem. Performance should be a series of peaks and valleys rather than a steady incline.