question

SQLRocker avatar image
0 Votes"
SQLRocker asked SQLRocker edited

How to convert 'Process % Processor Time' value to 'Processor % Processor Time'

Hi, i have read a few articles online but i am still looking for a way to convert 'Process % Processor Time' value to 'Processor % Processor Time' ie what % of CPU was a process using during the time of a issue.

Details - So we have a baseline perfmon datacollector setup on sql server, OS is Win Server 2016, say a issue happened last night, and i need to find which all processes were using what % of overall CPU, for example was sqlservr using 20% of overall cpu , and so on ... what were all the processes doing wrt overall CPU.


https://social.technet.microsoft.com/wiki/contents/articles/12984.understanding-processor-processor-time-and-process-processor-time.aspx tells that 'Process % Processor Time' value is a range from 0 to (No of Logical CPUS * 100) , so in my case , cpu = 20, so this range is 0 to 2000.

Now i am analyzing the blg using PAL, which gives me the analysis of 'Process % Processor Time' too,

115890-image.png

so above the max value is 1092, which is less than 75% of 2000 , so why is it showing it.... what am i missing, thanks.


sql-server-generalwindows-server
image.png (8.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AmeliaGu-msft avatar image
1 Vote"
AmeliaGu-msft answered

Hi SQLRocker,

convert 'Process % Processor Time' value to 'Processor % Processor Time' ie what % of CPU was a process using during the time of a issue.

I’m afraid you cannot. You can add Processor\% Processor Time counter instead.

so above the max value is 1092, which is less than 75% of 2000 , so why is it showing it

Sorry that I’m not familiar with PAL. You can go to Performance Monitor to analyze .blg file. Please refer to this video which might help.

Best Regards,
Amelia


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SQLRocker avatar image
0 Votes"
SQLRocker answered MotoX80 commented

Thanks @AmeliaGu-msft , I did see the video and it was helpful. I don't know why you said the conversion is not possible, seeing the video it was pretty simple and it was pretty much what i was also thinking about before, it clarified a lot though.

Simply put what the speaker in that vid was saying is :

  • If # of logical CPU's = 1 , then nothing really needs to be done , one can simply look at the value of 'Process % Processor Time' in perfmon & you are set, if example if it says 60, it means that the process is taking 60% of the overall CPU. So, look at the screen and you are set, no maths needed.

But maths is involved if # of logical CPU's > 1, which would pretty much be the case all the time, even my laptop has more than 1 cpu, so ofcourse servers will have too:

in this case you would use this formula, which is simple:

  • How much CPU a process is using at a particular instant of time = (x/r)*100
    where , x = Its 'Process % Processor Time' value
    r = Range , which is # of logical cpu's times 100

so if i take my max value from above its, (1092/2000) * 100 = 54.6 %

Now why PAL says > 75%? This question remains.



· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Apparently "PAL" is not calculating it correctly. We do not know what "PAL" is? Is that an application of some kind?

0 Votes 0 ·

That source code is very old. It is very likely it does not support current processors.

0 Votes 0 ·
Show more comments
SQLRocker avatar image
0 Votes"
SQLRocker answered SQLRocker edited

I have asked a question here, https://github.com/clinthuffman/PAL/issues/70 , thanks.

In the meantime, I think I have found a quick way to see if any process is a issue, on perform properties-goto Graph & make the 'vertical scale max' = r, so in my case make it 2000, and then you can see all the processes and make a guess about who is highest at a particular time, for example if something is around 1000, it means its using 50% cpu and so on.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.