How Virtual CPU & Logical CPU works?

Experts (wmp) -

I would like to understand the how the Virtual CPU works in AIX Lpar config?

What is the optimal value that we can specify in the following config?

SMT = 4

PHY CPU  = 16

VCPU = 20 ?

Logical CPU = ?

When we plot the % CPU report using NMON the logical CPU never match with the Physical CPU %.  How do we fix this issue?

LVL 18
Who is Participating?
Hi Sve!

How does it work?

When configuring an LPAR please distinguish between Processing Units and Virtual Processors.

Processing Units (PU) are real CPU cores, Virtual Processors (VP) are the processors an LPAR "sees". "Logical CPU" means "SMT Thread", so with let's say 2 VCPUs and SMT-4 the LPAR will see 8 logical CPUs.

Further distinguish between "Dedicated" and "Shared" mode.

In dedicated mode you assign whole PUs and one VP per PU to an LPAR.
The PUs are going to be used exclusively by that LPAR and are thus lost for other LPARs.

In shared mode you assign PUs in fractions of 0.1 (Power6 and below) or 0.05 (Power7 and up) and VPs (whole numbers) to an LPAR.

The rule is that you must assign at least 0.1 (0.05) PU per VP, and that you can assign 1 PU per VP at max.
This way a virtual processor is dynamically backed by more or less hardware.
The LPAR will always have the configured PUs available for use, but can use up to one PU per VP, if contention between partitions allows and if it's configured as "uncapped".
In "capped" mode the LPAR cannot use more than its configured PUs, and if it's uncapped and if there is contention the amount of usable PUs is calculated based on a "Variable Capacity Weight".

There are three values you'll have to configure, for PUs as well as for VPs - minimum, desired, maximum.

"Minimum" is the number of PUs which must be free in the managed system (the hardware machine) to allow the partition to start, and it's the limit down to which you can decrease PU/VP allocation "on the fly" by "Dynamic Logical Partitioning".

"Desired" are the PU/VP values you usually want to run the LPAR with.

"Maximum" is the limit up to which you'll be allowed to increase PU/VP allocation "on the fly" by "Dynamic Logical Partitioning".

Optimal value?

First, the number of logical processors is the result of (number of virtual processors * SMT factor), so this is not a value of interest yet.
In your example the LPAR in question will see 80 logical CPUs, by the way.

We'll have to decide which number of Processing units and Virtual CPUs to assign to the LPAR.

As you might guess, there is no "optimal" value. All depends on how many LPARs you're going to configure and what the purposes of those LPARs will be .

Taking your values you can configure 1 to 160 (320) LPARs with 0.1 (0.05) to 16 PUs each, with 1 to 160 (320) VPs each and thus 4 to 640 (1280) logical CPUs each,

Every combination between these limits is possible, as long as the above mentioned configuration rules are obeyed.

Some considerations:

- Map PU -> VP one-to one if you expect few but expensive threads (DB server?).

- Map more VPs (up to 10/20) to a single PU if you expect a lot of inexpensive threads (Web Server?)

- Please remember that an LPAR cannot use more physical cores than there are virtual processors configured for it.

- Assign as many PUs to the LPAR as required and as you can afford.
-- Examine the NMON statistics ("Physical CPU vs. Entitlement") and adjust the entitlement to get close to the PHYs value.

Does this last advice answer your "NMON" question?
If it doesn't please tell me which report section you're referring to, and give a bit more detail.

sventhanAuthor Commented:

That an AWESOME explanation that I ever could get. I was also going thru all your previous post related to NMON and LPAR to learn more about this.

We've been keeping the NMON and TOPas snapsnots for last 12 months. When we generate the NMON analyzer report out of it, it will create a pretty neat excel output (like the one attached).

I've a question from the output(excel)

The TAB LPAR shows Physical CPU vs. Entitlement and LCPU %.

Another TAB ALL_CPU shows Physical CPU %.

Why this Physical CPU % <> Logical CPU % in LPAR tab while the entitlement says all the physical cpus are fully engaged as you see in the LPAR tab?

Thanks for you valuable time.


Please be aware that under "LPAR" youre seeing real values from the server perspective, whereas "CPU_ALL" shows what the LPAR itself assumes to be real.

"CPU_ALL" shows what the LPAR did with the CPU cycles allocated to it by the hypervisor - thus the values User+Sys+Wait+Idle add up to ~100% which says nothing about the consumption of real hardware resources.

"CPU_ALL" does not show Physical CPU %!

And forget this "Logical CPU" value!
It's just ( Virtual CPUs * SMT factor ) and has nothing to do with resource consumption.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

sventhanAuthor Commented:
Great and Thanks for the nice help.

Oracle OEM and other monitoring tools does not reflect the Physical CPU %. It always match with the logical CPU.  some of our CPU % based reporting based on OEM and these tools which are not accurate.

We've also created a SR with oracle to see whats going on at their end.

Thanks again.

Ok, but please don't stress that term "Logical CPU" too much.

What you mean is "Virtual CPU" as opposed to "Physical CPU".

To repeat it: Logical CPU is Virtual CPU times SMT factor!
sventhanAuthor Commented:
Thanks for the help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.