How Virtual CPU & Logical CPU works?

Posted on 2013-06-13
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 68

Accepted Solution

woolmilkporc earned 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

740 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