12.4 Performance Analysis

In this section, system performance is analyzed to determine whether a system is CPU bound or memory bound. There is also a discussion on the idle time for Symmetric Multiprocessors (SMP) and Uniprocessor (UP) systems.

The following are some terms used during this discussion.

CPU bound
A system is said to be CPU-bound if the total system (sy) and user (us) CPU usage is approaching 100 percent. This would imply that idle time and wait time for CPU are approaching zero.
Memory bound
A system is memory-bound if some virtual memory is forced out to disk, meaning the system is waiting on relatively slow disk instead of relatively fast RAM. This is indicated by a non-zero value in page-in (pi) and page-out (po) values.

12.4.1 Determining CPU Bound and Memory Bound Systems

Using the output from the vmstat command, the values for the sy and us columns is used to continue with this discussion.

You need to obtain a preliminary look at the performance of the system as shown in Figure 108.

Figure 108: vmstat Report of CPU-Bound System

In this section, you will look at the sy and us columns for the CPU usage to determine if the system was CPU-bound during the time the vmstat command was gathering system information.

Remember that a system is CPU-Bound if the Total system and user CPU usage approaches 100 percent.

For rows two through Five, the System +User CPU Usage are:

Row 2 =(66+31)%=97% and r = 2

Row 3 =(77+23)%=100% and r = 2

Row 4 =(60+40)%=100% and r = 4

Row 5 =(88+12)%=100% and r = 3

There are two indications that this system is CPU-bound.

To determine if a system is memory bound, the pi and po columns are taken into consideration. As defined in 12.4 Performance Analysis, a system is memory bound if the average page in rate (pi) for paging spaces and the average page out rate (po) for paging spaces were non-zero.

12.4.2 Idle Time Calculations

Idle time calculations on an Symmetric Multiprocessor and an Uniprocessor system are the same. In an SMP environment, the output received from the vmstat and iostat commands are a summary of the system wait and idle time across all processors. Therefore, need only use the tools as laid out in the previous sections and calculating the system idle time based on the output received.

When calculating total system idle time over an interval, both the percentage of idle time(id), and the percentage of wait time (wa) are to be considered. Both fields are obtained from the vmstat command output.


Total CPU Idle Time % = wait % + Idle Time %

In order to calculate the time that the system is idle using the output from the vmstat command, perform the following:

  1. Calculate the average percentage idle time over the interval.

    Given the following output from an SMP system, calculate the system idle time from the command vmstat 900 4, that is, an output every 900 seconds or (15 minutes) four times.

    kthr     memory             page              faults        cpu
    ----- ----------- ------------------------ ------------ -----------
     r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
     0  0 11015 205693   0   0   0   0    0   0 102   11   6  0  0 99  1
     0  1 13014 203638   0   0   0   0    0   0 513  202 233  0  0 97  2
     0  1 13903 202718   0   0   0   0    0   0 528  256 262  0  0 95  4
     0  1 13008 203613   0   0   0   0    0   0 509  178 225  0  0 99  1

    Average CPU Idle Time percentage = Sum (%Idle Times(id) + %wait)/ # readings, therefore, the Average CPU Idle Time percentage = ((99+1) + (97+2) + (95+4) + (99+1))/4 = 99.5%

  2. Then calculate the Total CPU Idle Time in minutes.

    These readings were obtained over one hour, therefore, total CPU Idle Time for this system = 99.5% x 60 minutes = ~59 minutes

12.4.3 Calculating Paging Rate

Paging rate is the average number of page-ins and page-outs per CPU cycle.

If the pagein/pageout (pi/po) ratio is greater than one, it is indicating that for every pagein there has to be at least one pageout and, therefore, points to high paging activities. This system is, therefore, said to have a high paging rate.

12.5 Quiz