CPU Utilization

Hi All,

Can some one help me in finding % CPU Utilization ?

From VMSTAT command, How we can find % utilization ?

Thanks

You can subtract the idle ("id") column from 100 and that is the percent of your CPU used:

kthr    memory              page              faults              cpu
----- ----------- ------------------------ ------------ -----------------------
 r  b    avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa    pc    ec
 0  0 331429  5036   0   0   0   0    0   0  22  437 266  5  7 88  0  0.02  16.8
 0  0 331429  5036   0   0   0   0    0   0  22  253 255  3  4 93  0  0.01  10.4
 0  0 331428  5037   0   0   0   0    0   0  28  265 254  3  5 92  0  0.01  11.7
 0  0 331428  5037   0   0   0   0    0   0  29  271 254  3  4 93  0  0.01  11.0

When you run "vmstat" you see 5(6) columns in the "cpu" block. They are labeled "us", "sy", "id", and "wa" (on LPARs with a shared processor there are two additional columns "pc" and "ec").

  • id
    Gives the percentage of the total processor resources left over. This is the complement to 100% after adding up the other values (see below)
  • wa
    Gives the percentage of the total processor resources spent idle whlie the system has outstanding I/O requests.
  • us, sy
    Give the percentage of the total processor resources spent executing user programs ("us") and system calls ("sy").

There are two more columns on LPARs with shared processors, "pc" (number of physical processors consumed) and "ec" (entitled processor capacity consumed), which tell you how much of the underlying real hardware ("pc") was used and how much of the resources the LPAR is allowed to allocate was consumed.

Typical problems and their symptoms:

  • "us" high, ("sy" high too), "wa" and "id" near zero
    The system is processor-bound: the resources the system can use are used up by programs. High program loads ("us") will typically drive up the number of system calls ("sy") too, but that doesn't have to be so. Ultimately all your processing power is used. If the system is too slow it would gain from more processors.

  • "us" low, ("sy" low too), "wa" high, "id" near zero
    The system is I/O-bound: it is not spending all too much time executing your programs ("us"/"sy" is low), but it spends a lot of time waiting for some I/O to happen. There are a lot of programs which could continue to do something - if they wouldn't have to wait for some (disk) I/O to happen. Cure is to get the system more I/O bandwidth somehow: replace SCSI-disks with FC-disks for instance, etc..

    This could also happen if the system has not enough memory and is constantly swapping: since every process has to wait until swapping operations have finished all the processes have to wait for the disks. If "wa" is high and the second column ("b" - blocked processes) is non-zero, perhaps along with "pi" and "po" being not (near) zero too, then your system has probably not enough memory for what it is doing at this moment.

  • "pc" or "ec" high (90% and more)
    The system is processor-bound, because there are not enough resources allocated for it. Correct this at the HMC and give more (physical) processor resources to the LPAR.

I hope this helps.

bakunin

1 Like

when looking at cpu utilization, watch the us+sy values but also look at the EC (entitled capacity).
EC can be, if the lpar is uncapped, more than 100%.

Here's an example

System configuration: lcpu=4 mem=2048MB ent=0.20

kthr    memory              page              faults              cpu
----- ----------- ------------------------ ------------ -----------------------
 r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs    us sy id wa    pc  ec
 0  0 322989 79334   0   0   0   0    0   0 115 54342 5041 40 57  3  0  0.50 247.9

the example shot idle=3%, so CPU utilization is 97%, but the EC value is almost 250% meaning, this LPAR is uncapped and is using 2.5 times is original assigned CPU. So now it's utilizing 97% of (2.5 times 0.2cpu)

when the partition is uncapped. EC is max 100%, so max CPU utilization is 100% of 0.2 CPU