Solved

How Virtual CPU & Logical CPU works?

Posted on 2013-06-13
6
4,648 Views
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?

Thanks,
sve
0
Comment
Question by:sventhan
  • 3
  • 3
6 Comments
 
LVL 68

Accepted Solution

by:
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.

wmp
0
 
LVL 18

Author Comment

by:sventhan
ID: 39247254
WOW!!!

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.

Sve.
Book15.xlsx
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39247335
OK.

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.
wmp
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 18

Author Comment

by:sventhan
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.

sve.
0
 
LVL 68

Expert Comment

by:woolmilkporc
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!
0
 
LVL 18

Author Closing Comment

by:sventhan
ID: 39248367
Thanks for the help.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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…
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.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now