21.02.2013 Views

AIX 5L Problem Determination - IBM Redbooks

AIX 5L Problem Determination - IBM Redbooks

AIX 5L Problem Determination - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The cs column<br />

The cs column shows the number of context switches per second observed in<br />

the interval. The physical CPU resource is subdivided into logical time slices of<br />

10 milliseconds each. Assuming a thread is scheduled for execution, it will run<br />

until its time slice expires, until it is preempted, or until it voluntarily gives up<br />

control of the CPU. When another thread is given control of the CPU, the context<br />

or working environment of the previous thread must be saved and the context of<br />

the current thread must be loaded. The operating system has a very efficient<br />

context switching procedure, so each switch is inexpensive in terms of<br />

resources. Any significant increase in context switches, such as when cs is a lot<br />

higher than the disk I/O and network packet rate, should be cause for further<br />

investigation.<br />

If the system has low performance because of a lot of threads on the run queue<br />

or threads waiting for I/O, then ps command output will be useful in determining<br />

which process has used the most CPU resources.<br />

10.1.3 The ps command<br />

The ps command is a flexible tool for identifying the programs that are running on<br />

the system and the resources they are using. It displays statistics and status<br />

information about processes on the system, such as process or thread ID, I/O<br />

activity, and CPU and memory utilization.<br />

The ps command output and CPU monitoring<br />

Three of the possible ps command output columns report CPU usage, each in a<br />

different way, as provided in Table 10-1.<br />

Table 10-1 CPU-related ps output<br />

Column Value<br />

C Recent CPU time used for a process.<br />

TIME Total CPU time used by the process since it started.<br />

%CPU Total CPU time used by the process since it started, divided by the<br />

elapsed time since the process started. This is a measure of the CPU<br />

dependence of the program.<br />

The C column<br />

The C column can be generated by the -l flag and the -f flag. In this column, the<br />

CPU utilization of processes or threads is reported. The value is incremented<br />

each time the system clock ticks and the process or thread is found to be<br />

running. Therefore, it also can be said to be a process penalty for recent CPU<br />

usage. The value is decayed by the scheduler by dividing it by two once per<br />

Chapter 10. Performance problem determination 241

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!