Reputation: 11
I ran the lparstat command and got this output.. Need to know which field to parse for overall CPU allocation, CPU usage, free CPU for this AIX server and how to parse that information..
System configuration: type=Shared mode=Uncapped smt=4 lcpu=12 mem=24576MB psize=5 ent=0.30
%user %sys %wait %idle physc %entc lbusy vcsw phint %nsp %utcyc
----- ----- ------ ------ ----- ----- ------ ----- ----- ----- ------
37.4 30.4 4.0 28.2 0.96 320.0 22.0 14315232399 16476954189 101 1.04
Upvotes: 1
Views: 1204
Reputation: 46
As AIX lives inside LPar, it can operate with provided by PowerVM (Power hypervisor) amount of entitled capacity (EC), which is actually only a time slice. There are four possible types of CPU time allocation to LPar:
Because of PowerVM's flexible CPU time management, every AIX native statistic utility includes two additional parameters:
Entitled Capacity. This is how much CPU time of a single core is guaranteed to LPar during each time slice
Physical Consumption. This is how much of guaranteed core time is consumed by LPar during each time slice
PowerVM will review each 10ms CPU time dedication to each LPar. Based on your example, there is [4] CPU dedication option used, with 0.3 core entitled to LPar
System configuration: type=Shared mode=Uncapped smt=4 lcpu=12 mem=24576MB psize=5 ent=0.30
This means that your LPar is guaranteed with 0.3 CPU time and allowed to consume (if there are any available) up to number of Virtual CPU count (specified in LPar's profile), lcpu/smt or 12/4=3 -> up to 3.0 CPU time. This is the same as 1000% of Entitled capacity and up to 3.0 Physical Consumption (physc).
So, if you need to know how much CPU is used, you should take a look at Physical Consumption (physc) and Entitled Capacity (ent, %ent) fields. Lets say, in your example you have
System configuration: type=Shared mode=Uncapped smt=4 lcpu=12 mem=24576MB psize=5 ent=0.30
%user %sys %wait %idle physc %entc lbusy vcsw phint %nsp %utcyc
37.4 30.4 4.0 28.2 0.96 320.0 22.0 14315232399 16476954189 101 1.04
Your LPar consumes 3.2 times more CPU than it is guaranteed, because %entc=320. This may be absolutely normal, depends on your overcommitment strategy. In general considerations, if you see %entc lower than 100% that would mean your LPar is underloaded, and more than 100% means LPar is overloaded.
As for parsing, I'd cut off all letters from output with grep -v [a-z]
, then grep for numbers with grep [0-9,.]
and print column #6 which stands for %entc (or any other based on your need): awk '{print $6}'
lparstat | grep -v [a-z] | grep [0-9,.] | awk '{print $6}'
would return 320.0
This IBM course may be useful for you: https://www-03.ibm.com/services/learning/ites.wss/zz-en?pageType=course_description&cc=&courseCode=AN31G
P.S. If you need to know your LPar's CPU Profile settings from AIX side, you can use lparstat -i
command
P.P.S You probably should take a look at LPars profiles/weights or review consolidation policy on your physical machine. There is too much phantom interrupts (phint) which may mean LPar is competing with others for shared resources (CPU).
Upvotes: 1