dropdown menu


VIRTUAL PROCESSORS AND ENTITLED CAPACITY

Processing Capacity
(Processing Units, Entitled Capacity)

Capacity Entitlement value is the time when you can access the core. Processing capacity can be configured in fractions of 0.01 processors. The minimum amount of processing capacity that has to be assigned to a micro-partition is 0.1 processors. (Starting with POWER7+ minimum is 0.05)

On the HMC processing capacity is specified in terms of processing units. (To assign a processing capacity representing 75% of a processor, 0.75 processing units are specified on the HMC.)

Once a micro partition is activated,  processing capacity is usually referred to as entitled capacity. This entitled capacity is reserved for that partition when it is started. The total entitled capacity of all the partitions configured on the system can never exceed the number of processors in that system.

------------------------------------------------

Capped and uncapped mode

Micro-partitions have  a specific processing mode that determines the maximum processing capacity given to them from their Shared-Processor Pool:

Uncapped mode: processing capacity can exceed the entitled capacity when resources are available in their Shared-Processor Pool (if there is competition amongst several partitions for unused processor capacity the uncapped weight will determine the sharing)
Capped mode: processing capacity can not exceed the entitled capacity

Uncapped Weight: Extra capacity is distributed between partitions in uncapped mode, by checking its uncapped weights. The higher the uncapped weight of a micro-partition, the more processing capacity the micro-partition will receive. (You must specify the uncapped weight when it is created.) The uncapped weight must be a whole number from 0 to 255. Default is 128. (If you set the uncapped weight at 0, the micro-partition will be treated as a capped partition.)

------------------------------------------------

Virtual Processor


A virtual processor is a representation of a physical processor that is presented to the operating system. A virtual processor cannot have a greater processing capacity than a physical processor. The capacity of a virtual processor will be equal to or less than the processing capacity of a physical processor. In terms of capacity, a physical processor can support up to 10 virtual processors.(From Firmware 760, 20 virtual processors.)

The Hypervisor uses a 10 ms dispatch cycle; each virtual processor is guaranteed to receive its entitled capacity of processor cycles during each 10 ms dispatch window. The Entitlement Capacitiy will be distributed equally between the Virtual Processors by the Hypervisor.

For example, if a logical partition has 1.60 processing units and 2 virtual processors, each virtual processor has 0.80 processing units. But the same LPAR with 4 virtual processors, each virtual processor has 0.40 processing units.

For example, if you have a partition with 0.50 processing units and one virtual processor, the partition cannot exceed 1.00 processing units. However, if the same partition with 0.50 processing units was assigned two virtual processors and processing resources were available, the partition could use an additional 1.50 processing units
The number of Virtual Processors can not be extended over 10X of the Entitled Capacaty. (From Firmware 760 it is 20X)
(If EC=0,5 then the maximum number of Virtual Processor can not be over 5, or from Firmware 760 over 10.)

------------------------------------------------

Desired, minimum and maximum values

When you set up a partition profile, you set up the desired, minimum, and maximum values you want for the profile. When a partition is started, the system chooses the partition's entitled processor capacity from this specified capacity range.

When starting a micro-partition, preference is given to the desired value, but this value cannot always be used because there may not be enough unassigned capacity in the system. In that case, a different value is chosen, which must be greater than or equal to the minimum capacity attribute. If the minimum capacity requirement cannot be met, the micro-partition will not start.
The maximum value is only used as an upper limit for dynamic operations. (adding RAM/CPU as a DLPAR operation).

------------------------------------------------

Processor Affinity (and processor binding):

Hypervisor always attempts to dispatch the virtual processor on to the same physical processor that it previously ran on. (To reduce contex switching...) This behavior is called processor affinity.  If this is not possible, the POWER Hypervisor will broaden its search out to other processors.

With AIX 6.1 TL5 and AIX 7.1 binding processors is available to application running in a shared LPAR  (an application process can be bound to a virtual processor).  PowerVM hypervisor (from firmware level 730) maintains three levels of affinity for dispatching, such as core, chip and node level affinity. By maintaining affinity at hypervisor level as well as in AIX, applications may achieve higher level affinity through processor bindings.

------------------------------------------------

Processor Folding:

Virtual processor folding puts idle virtual processors into a hibernation state so that they do not consume any resources.            
There are several important benefits of this feature: improved processor affinity, reduced POWER Hypervisor workload...
It will reduce the Physical Core usage (physc) at LPAR level.

------------------------------------------------

How to estimate the number of virtual processors per uncapped shared LPAR:

The first step would be to monitor the utilization of each partition and for any partition where the average utilization is ~100%, then add one virtual )processors. (use capacity of the already configured virtual processors before adding more

If the peak utilization is well below 50%, then look at the ratio of virtual processors to configured entitlement and if the ratio is > 1, then consider reducing the ratio.  (In any case if there are too many virtual processors configured, AIX can “fold” those processors.)

AIX monitors the utilization of each virtual processor and the utilization of an PLPAR, and if utilization goes below 50%, AIX will start folding down the virtual CPUs so that fewer virtual CPUs will be dispatched. (If utilization goes beyond 50% AIX starts unfolding virtual CPUs.)

------------------------------------------------

Considerations for Virtual Processor (VP) and Entitled Capacity:

- Lpars that require high performance (such as critical database) can be forced to get the best resources by activating the critical LPAR first prior to activating any other LPARs including VIO Server.

- The best practice for LPAR entitlement would be setting entitlement close to average utilization and let the peak addressed by additional uncapped capacity. 
(exceptions could be LPARs with higher priority)

- For each shared LPAR the number of VPs must be less than (or equal) to the number of cores of the shared pool

- Shared uncapped LPARS with too low VPs will not cover Production Need (VP number is a limit for uncapped LPARs)

- When AIX folding is turned off it can happen that PhysC (physical cores used) is high, but AIX shows high percentage of idle time. (This is because unused Virtual Processors are also assigned to cores, but they are not doing any work at all.)

------------------------------------------------

Checking how many Virtual Processors are active:

root@bb_lpar:/ # lparstat -i | grep Virt
Online Virtual CPUs                        : 2                               <--we have 2 virtual processors configured
Maximum Virtual CPUs                       : 8
Minimum Virtual CPUs                       : 1
Desired Virtual CPUs                       : 2

root@bb_lpar:/ # bindprocessor -q
The available processors are:  0 1 2 3 4 5 6 7                               <--this shows smt=4 active (4 threads/virtual processor)

root@bb_lpar:/ # echo vpm | kdb
...
   0     0  ACTIVE      0 AWAKE        0000000000000000  00000000  00
   1     0  ACTIVE      0 AWAKE        0000000000000000  00000000  00
   2     0  ACTIVE      0 AWAKE        0000000000000000  00000000  00
   3     0  ACTIVE      0 AWAKE        0000000000000000  00000000  00
   4     0  DISABLED    0 AWAKE        0000000000000000  00000000  00        <--4 lines are DISABLED, so 1 Virt. proc. is inactive (folding)
   5    11  DISABLED    0 SLEEPING     00000000515B4478  29DBE3CA  02
   6    11  DISABLED    0 SLEEPING     00000000515B4477  2C029174  02
   7    11  DISABLED    0 SLEEPING     00000000515B4477  2C0292A1  02

------------------------------------------------

11 comments:

  1. What is the purpose of virtual processor? is it mandatory to specify the amount VPs in LPAR profile? if we dont specify what will happen?

    Thanks

    ReplyDelete
  2. A virtual processor is a representation of a physical processor that is presented to the operating system. A virtual processor cannot have a greater processing capacity than a physical processor.. If you didn't specify virtual processor it will work as whole processor. Slicing and uncapped mode cannot be used

    ReplyDelete
  3. Please let me know calculation of Vcpu..

    ReplyDelete
  4. Great stuff. Many thanks for author :)

    ReplyDelete
  5. root@bb_lpar:/ # lparstat -i | grep Virt
    Online Virtual CPUs : 2 <--we have 2 virtual processors configured
    Maximum Virtual CPUs : 8
    Minimum Virtual CPUs : 1
    Desired Virtual CPUs : 2

    Question
    -------------
    in here the max virtual cpu can be 8 means while the creation of this lpar the entitlement capacity was given as 0.8 of the physical processor because 10X of the entitlement ? is it using 0.8 of whatever the physical capacity there?

    pls clear

    ReplyDelete
  6. Hello, thanks for such useful information !!!

    1. I have one small doubt. You mentioned that: “For example, if you have a partition with 0.50 processing units and one virtual processor, the partition cannot exceed 1.00 processing units.” Is this mean that in this case LPAR can use twice time more than entitled cpu?
    2. What kind of cpus is associated to the Pools (Entitled or Virtual CPU).

    Thanks in advance for answer 

    ReplyDelete
    Replies
    1. Hi,

      1. basically yes. I meant that uncapped LPARs can extend beyond their entitled capacity (in this case 0.5), but not above the limit of Virtual Processors (in this case 1).

      2. In the HMC GUI when you do that, you assign Processing Units to the Pools.

      Delete
  7. How can we calculate number of virtual processors and logical processors on server? .
    1> Is it the sum of cores of all physical processors?
    E.g. 2 quad core processors = 8 Virtual processors?
    Is SMT value meaning Cores of processors?
    E.g. Will Quad core processors have SMT=4 as output of “smtctl” command ?

    ReplyDelete
  8. How can we calculate number of virtual processors and logical processors on server? .
    1> Is it the sum of cores of all physical processors?
    E.g. 2 quad core processors = 8 Virtual processors?
    Is SMT value meaning Cores of processors?
    E.g. Will Quad core processors have SMT=4 as output of “smtctl” command ?

    ReplyDelete
  9. how do you find the number of cores in an LPAR ?

    ReplyDelete
  10. I have below configuration.

    Online Virtual CPUs : 2
    Maximum Virtual CPUs : 4
    Minimum Virtual CPUs : 1

    Is this means , still i can increase the virtual CPU count to 4 and it will improve the performance

    ReplyDelete