I am trying to come up with a formula to calculate the threshold for LPAR cpu utilization in a shared mode. It sounds like I need to calculate the Relative Virtual CPU and then try to calculate the cpu utilzation. Given the following lparstat output:

lbusy gives you the relative number of "logical" cpus busy. Since you are smt4 your have 96/4 virtual processors - 24 virtual (i.e. maximum physical processors at any moment).

Since your entitlement is 16 - the PHYP has reserved (declared as Home) two sockets of 8 cores each. The 8 extra virtual processors will run, ideally, on these home processors.

16 entitlement == 160 msec processing power every 10 msec guaranteed.

phsyc * 10 = # msec actually used (not processors!)
lbusy * 96 = average number of threads busy; if this number is nearly equal to physc, then you are running, mainly, single-threaded and you could easily reduce the number of VP assigned (to 'force' more utilization from a single processor (i.e., lbusy goes up faster than physc).

Well, I will try and write it again. Trying to answer something complex just before dinner is poor timing. And this is complex stuff. I travel all around Europe to look at systems and explain how to modify configurations to increase overall system utilization. - read - not an easy subject for a forum - a "whitepaper" and/or a presentation is better.

However, read the man page and/or google on lbusy. The IBM infocenter should at least say something.

Also look at physc (which is actually a count of the msec used (/10), not the actual # of (virtual) processors used.

For your specific question I would like to ask you to look at the output of sar -P ALL - and see if it already answered for you.

Post your remaining questions, also include what this is for (if I understand your objective I can give a better answer, otherwise it tends to become technical (nerdy) mumbo-jumbo).

Thank you so much for helping me with this. What I am trying to do is get relative Usage percentages in share lpar environment so that it is very convenient to immediately know what is the usage, are we within capacity etc.

Here is the formulat that I am using to calculate the Relative CPU usage:

With the above formulas, I am calculating the Relative CPU usage in share lpar environment. So, If I wanted to calculate the threshold on relative percentage, what would be the formula.

Eventually, I would like to create a relative cpu percent chart, put a horizontal line for the threshold and looking at the chart, I would quickly know where am I at with the CPU. Does this make sense?

I do not think this is going to give you a statistic you really want, but I may be mistaken - as it all depends on what you are trying to "relate" to/with each other.

The physc ($PC) value is already "relative" in the sense that you are computing it (I think) because it is an expression of the processing milliseconds used for the time period (9.1 means 91 msec per 10 msec - which is the PHYP real-time scheduling window - entitlement is guaranteed processing - if requested -, in real terms: (EC * 10) msec per 10 msec.

So if I use 91 msec - that might be 10 processors (9 running non-stop for 10msec, and one (the tenth) running only 1msec, or it could be 91 processors all running only 1 msec.

Looking at user/sys time and comparing them to physc could make sense on Power6 and earlier - where one thread running user+sys = 100 could equal physc = 1.0, but on POWER7 a single thread is considered to only be 0.66 of 1.0 while the other three threads (logical cpu 1,2,3 = even though idle is 100% are considered to be "using" .11 physc each - because there are additional processing components on a Power7 that, by definition, are not being used. In other words, it is impossible for a single thread to fully utilize a POWER7 processor potential.

In short, I think the statistic to use is just physc. You could perhaps give it a weight by multiplying it by lbusy% - but this depends on what you are trying to make "standardized".