3 replies Latest Post - ‏2009-01-15T21:37:53Z by Pave1
35 Posts

Pinned topic LPAR CPU and Memory Utilization

‏2008-12-02T12:58:16Z |
The following commands give me CPU & Memory utilization attributes for Logical partitions.

1. lshwres -m <managed system> -r mem --level lpar -F lpar_id,run_mem,curr_mem   Output:   1,1536,1536 2,2048,2048 3,2048,2048 4,2048,2048     2. lshwres -m <managed system> -r proc --level lpar -F lpar_id,run_proc_units,curr_proc_units   Output:   1,0.20,0.20 2,0.20,0.20 3,0.20,0.20 4,0.20,0.20 

Currently I am using following formulas for calculating CPU & Memory utilization from the attributes gathered from the commands above.

% Memory Utilization = (run_mem/curr_mem) * 100 % CPU Utilization    = (run_proc_units/curr_proc_units) * 100 

The problem I am facing here is everytime I calculate CPU/Memory Utilization I get the ratio as 100%.

Is the approach I am using for the calculation is correct or I am missing some important attribute which should be included in the formulas.
Updated on 2009-01-15T21:37:53Z at 2009-01-15T21:37:53Z by Pave1
  • SystemAdmin
    1744 Posts

    Re: LPAR CPU and Memory Utilization

    ‏2008-12-02T14:13:23Z  in response to neerajsathe
    Let's look at memory first. There is no way via the HMC to determine the actual utilization of memory by a partition. All you can tell is how much memory has been allocated to the lpar - whether the partition is utilizing that memory or not is unknown without running a tool such as topas on the partition itself.

    Now for a discussion on Current, Pending and Runtime:

    Current: How much of the resource the hypervisor currently has allocated to the lpar.

    Runtime: How much of the resource the operating system currently has 'active'. This almost always matches the 'Current' value unless you are in the middle of a DLPAR operation, or are using a workload management application that tweaks the runtime value. This value is only useful when the lpar is powered on.

    Pending: How much of the resource the user has requested be allocated. This usually matches 'current' except when performing a DLPAR operation.

    So, to calculate the actual memory assigned to an lpar, you just need to look at the runtime memory value (when the lpar is on), or the current memory value (when the lpar is off. There is no need to divide them, or multiply them by 100.

    Now for CPU utilization. In the case of dedicated processors, just look at the current (or runtime) values as appropriate. For shared processors, the Hypervisor does in fact keep track of how many CPU cycles have been allocated to an lpar. This may be less than the runtime value, or may be more than the runtime value (in the case of an uncapped lpar). The HMC can keep track of this utilization via the lslparutil command. There are some good examples in the man page:

    Hope that helps!
    • seroyer
      352 Posts

      Re: LPAR CPU and Memory Utilization

      ‏2008-12-02T18:27:16Z  in response to SystemAdmin
      Actually, you can get CPU utilization data from lslparutil for dedicated processor partitions also, if you have the latest HMC/IVM, firmware, and OS levels (as of this November). Requires 340 firmware and HMC, VIOS 2.1 for IVM, and latest TL for AIX.
  • Pave1
    23 Posts

    Re: LPAR CPU and Memory Utilization

    ‏2009-01-15T21:37:53Z  in response to neerajsathe
    for CPU dedicated partitions you can get only CPU donations of them as far I know and only for following LPAR cfg:
    Processing mode Dedicated
    Processor Sharing Allow when partition is active
    Compatibility mode POWER6

    It is included in LPAR2RRD tool if you want it in graphical form apart of usual CPU and memory utilization.