Operating System - HP-UX
1752793 Members
6014 Online
108789 Solutions
New Discussion

pstat_getprocessor() shows wait I/O as always 0 however sar command always results in values above 0

 
kumar08
Frequent Visitor

pstat_getprocessor() shows wait I/O as always 0 however sar command always results in values above 0

We are using pstat_getprocessor() to find CPU utilization for individual cores. Here we got a issue reported from customer and we further checked and found that CPU wait calculated using pstat_getprocessor() always returns 0.

Formula used by us is CP_BLOCK+ CP_SWAIT+ CP_INTR

pCpu->stats.fWait = pProcessorInfo[cpu_number].psp_cpu_time[CP_BLOCK];
pCpu->stats.fWait += pProcessorInfo[cpu_number].psp_cpu_time[CP_SWAIT];
pCpu->stats.fWait += pProcessorInfo[cpu_number].psp_cpu_time[CP_INTR];

Total 30021
User 1 = (212 + 0) * 100 / 30021
System 0 = 95 * 100 / 30021
Idle 99 = 29714 * 100 / 30021
Wait 0 = 0 * 100 / 30021
Total 30021
User 0 = (41 + 0) * 100 / 30021
System 0 = 59 * 100 / 30021
Idle 100 = 29921 * 100 / 30021
Wait 0 = 0 * 100 / 30021
Total 30021
User 2 = (546 + 0) * 100 / 30021
System 1 = 228 * 100 / 30021
Idle 97 = 29247 * 100 / 30021
Wait 0 = 0 * 100 / 30021
Total 30021
User 0 = (27 + 0) * 100 / 30021
System 0 = 60 * 100 / 30021
Idle 100 = 29934 * 100 / 30021
Wait 0 = 0 * 100 / 30021
Total 30021
User 0 = (51 + 0) * 100 / 30021
System 0 = 82 * 100 / 30021
Idle 100 = 29888 * 100 / 30021
Wait 0 = 0 * 100 / 30021
Total 30021
User 0 = (26 + 0) * 100 / 30021
System 0 = 110 * 100 / 30021
Idle 100 = 29885 * 100 / 30021
Wait 0 = 0 * 100 / 30021
Total 30021
User 1 = (190 + 0) * 100 / 30021
System 0 = 97 * 100 / 30021
Idle 99 = 29734 * 100 / 30021
Wait 0 = 0 * 100 / 30021
Total 30021
User 1 = (428 + 0) * 100 / 30021
System 0 = 114 * 100 / 30021
Idle 98 = 29479 * 100 / 30021
Wait 0 = 0 * 100 / 30021

 

Also we checked sar command and it returns values greater than zero. i.e It reports the value like 3,2,4 for Wait I/O metric.

root@serv5040:/usr/storapi/bin> sar -u 1 50

 HP-UX serv5040 B.11.31 U ia64 10/20/16

 11:41:16 %usr %sys %wio %idle

11:41:17 2 1 3 94

11:41:18 2 1 2 95

11:41:19 2 0 4 94

11:41:20 2 2 4 92

11:41:21 4 2 6 88

11:41:22 2 0 4 94

11:41:23 2 1 3 94

11:41:24 3 7 7 83

11:41:25 3 8 5 84

 Average 3 2 5 91

 Can you please let us know how to fetch CPU Wait using pstat_getprocessor() correctly.?

Why there is difference between output from sar command and pstat_getprocessor().?

Please let us know in case any more information required.

 

3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: pstat_getprocessor() shows wait I/O as always 0 however sar command always results in values > 0

Have you contacted Support yet?

kumar08
Frequent Visitor

Re: pstat_getprocessor() shows wait I/O as always 0 however sar command always results in values &gt

not yet.

I am new to community.

Can anyone please share steps how to go ahead on this.

Dennis Handly
Acclaimed Contributor

Re: pstat_getprocessor() shows wait I/O as always 0 however sar command always results in values > 0

>Can anyone please share steps how to go ahead on this.

 

You need a support contract (SAID) to contact Support.