discrepency about CPU usage between iostat and prstat



Hi, Solaris guru,

The scenario I am talking about here might be interesting to you.

I have a netra t1 box running the latest solaris 10. It is a standalone
machine. That means there is no TCP/IP traffic etc. And actually there
is no any application or server running. The CPU idle is 99~100%

I wrote a sample C program which simply caculate the sin and atan for
degree 1~36000000. This testing code is apparently pure CPU intensive
(I didn't put any output line in the code, so no IO, no system call.
This makes sure the process will run in user-mode) and runs very long.

before I invoke the program, I have been running "iostat 3" and "prstat
3" to check the system activity. Actually nothing is going on. CPU is
totally idle. Which is good.

Then I invoke the testing program. iostat immediately shows that all
the CPU is being used by the testing program. user-mode 100%, system
mode 0%, CPU idle 0% (NOTE: kernel mode CPU usage: 0)

But at same time, prstat shows the program uses around 35% CPU and NO
other process is using much CPU power at all). Of course the CPU usage
by the testing process keeps increasing. About one minute later, the
usage by this process reported in prstat command gets to 99%.

Definitely there is no paging or disk activity going on as my code
doesn't read or write anything.

My question is why we see this kind discrepency in the first minute? .

.



Relevant Pages

  • Re: Solaris 8 performance
    ... i have a problem about mesuring cpu usage on Solaris 8. ... I run prstat -a and the output is ... NPROC USERNAME SIZE RSS MEMORY TIME CPU ... If i run ps with some pipes the total of cpu usage is similar to ...
    (comp.unix.solaris)
  • Re: Solaris 8 performance
    ... i have a problem about mesuring cpu usage on Solaris 8. ... I run prstat -a and the output is ... NPROC USERNAME SIZE RSS MEMORY TIME CPU ... If i run ps with some pipes the total of cpu usage is similar to ...
    (comp.unix.solaris)
  • Re: discrepency about CPU usage between iostat and prstat
    ... This testing code is apparently pure CPU intensive ... Then I invoke the testing program. ... prstat shows the program uses around 35% CPU and NO ... time interval should be the base for calculating cpu percentage. ...
    (comp.unix.solaris)
  • Solaris 8 performance
    ... I run prstat -a and the output is ... NPROC USERNAME SIZE RSS MEMORY TIME CPU ... If i run ps with some pipes the total of cpu usage is similar to ...
    (comp.unix.solaris)
  • Re: Yet another SVCHOST.EXE posting (my workaround)
    ... SVCHOST.EXE is an important part of Windows. ... Process Explorer you can see which and that is why I asked about the Command ... about the Windows Automatic Update service -a common cause of excessive CPU ... First off I killed PID 1302 and noticed that CPU usage fell down ...
    (microsoft.public.windowsxp.general)