Understanding Processor Usage Accounting

Programs vary a lot in terms of their patterns of processor usage. Understanding the processor usage of a program can help you to decide the priority at which it should run. It can also help you to diagnose inefficiencies in program design or problems in overall system performance.

The system divides the processor usage of a process into several categories, which can be displayed through system commands, examined through task attributes, or read in the system log.

The system command that displays processor usage information is the TI (Times) command. The following is an example of the output:

2139 TI

TIMES FOR 02139
PROCESS   = 0:00:07 LIMIT 0:01:20
IO        = 0:00:00 LIMIT 0:03:20
READYQ    = 0:00:00
HOLDQ     = 0:00:17
INITPBIT  = 0:00:06 290125 OPERATIONS  
ELAPSED   = 0:00:30
BOT       = Monday, November 12, 2007 (2007316) AT 06:31:53[ADM1]

In the TI command output, all the times are expressed in a format of <hours>:<minutes>:<seconds>. The following are the meanings of these fields in the TI command output:

  • PROCESS

    The accumulated processor usage of the process, with the exception of the process time spent on presence-bit operations. (See the following descriptions of INITPBIT and OTHERPBIT.) The LIMIT time, if displayed, corresponds to the MAXPROCTIME task attribute value.

  • IO

    The accumulated I/O usage for the process. The LIMIT time, if displayed, corresponds to the MAXIOTIME task attribute value.

  • READYQ

    The accumulated ready queue time for the process. Ready queue time is the time spent waiting for the processor to become available. If this value is excessive, it indicates either that the processor is overloaded or that other higher priority processes are dominating the processor.

  • HOLDQ

    The accumulated hold queue time for the process. This is the time that a process is prevented from using a processor because of the value of the CPURATEBIAS attribute.

  • INITPBIT

    The amount of processor time spent on initial presence-bit operations. These are operations that create arrays, files, and code segments for this process. This value is followed by a count of the number of presence-bit operations.

    If the value of INITPBIT is high compared to the value of PROCESS, this can be a symptom of poor program structure. For example, if a large local array is declared in a procedure that is entered repeatedly, then much processor time is spent recreating the array each time the procedure is entered, thus resulting in a high INITPBIT value. You can prevent this problem by declaring the array globally to the procedure, or by declaring the array with an OWN clause (in ALGOL programs only).

  • OTHERPBIT

    The amount of processor time spent on noninitial presence-bit operations for this process. Noninitial presence bit operations read arrays and code segments back into main memory after they have been overlaid. The value of OTHERPBIT can vary widely for different runs of the same program, depending on the memory demands that are made by other active processes. If this value is very high, it might indicate that memory is overloaded and the system is thrashing.

  • ELAPSED

    The amount of real time that has passed since the process was initiated. This value is stored in a different form in the ELAPSEDTIME task attribute.

    The value of ELAPSED can be greater than or less than the sum of the other values listed in the TI display. The ELAPSED value can be greater because it includes time spent waiting on events, and this waiting time is not displayed separately. The ELAPSED value can be less because, in some cases, a process might be using the processor and performing one or more I/O operations at the same time.

Most of the resource usage information that can be displayed for a process can also be interrogated through task attributes.

The ACCUMPROCTIME task attribute returns the accumulated processor time. The value does not include processor time spent on presence-bit operations. The INITPBITTIME, INITPBITCOUNT, OTHERPBITTIME, and OTHERPBITCOUNT task attributes return the times and counts for presence-bit operations. The ACCUMIOTIME task attribute returns the accumulated I/O time for the process. The ELAPSEDTIME task attribute returns the total elapsed time.

The values these task attributes return are expressed in units of 2.4 microseconds, except if the attributes are read from WFL, which expresses the values in units of seconds.

The system log (SUMLOG) records several categories of processor usage for each process. This information includes the processor time, I/O time, ready queue time, hold queue time, and p-bit times and counts. This information is stored in the Major Type 1, Minor Type 2 (EOJ) and Minor Type 4 (EOT) log entries. For a description of these log entry types, refer to the System Log Programming Reference Manual.