How Virtual CPU & Logical CPU works?

Posted on 2013-06-13
Medium Priority
Last Modified: 2013-06-14
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?

Question by:sventhan
  • 3
  • 3
LVL 68

Accepted Solution

woolmilkporc earned 2000 total points
ID: 39246942
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.

LVL 18

Author Comment

ID: 39247254

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.

LVL 68

Expert Comment

ID: 39247335

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.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 18

Author Comment

ID: 39247951
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.

LVL 68

Expert Comment

ID: 39248102
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!
LVL 18

Author Closing Comment

ID: 39248367
Thanks for the help.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month12 days, 21 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question