%cpu differences between sar and top



Hello,

I´m checking the performance of one RHEL running a java process and I use
the sar command and the top command to see the cpu usage and I get some
differences that I don´t understand.

First I´ll tell you how I check it:
for the sar command I run this:
sadc -F -L 1 1000 /home/user/log/output

for top I run this:
top -b -d 1 -n 1000 -p $PID

PID is the PID of my java process.

Well, when I run this I get this results:

PM CPU %user %nice %system %iowait %idle
07:09:09 PM all 35.75 0.00 7.25 0.00
57.00
07:09:11 PM all 50.00 0.00 13.43 0.00
36.57
07:09:13 PM all 23.56 0.00 7.27 0.00
69.17
07:09:15 PM all 36.75 0.00 8.00 0.00
55.25
07:09:17 PM all 66.08 0.00 10.22 0.25
23.44
07:09:19 PM all 31.17 0.00 6.23 0.00
62.59

top
TIME PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
19:09:09 26314 user 16 0 817m 324m 36m S 99.9 8.6 0:44.11 java
19:09:11 26314 user 16 0 817m 382m 36m S 99.9 10.1 0:46.70 java
19:09:13 26314 user 16 0 817m 381m 36m S 99.9 10.1 0:48.02 java
19:09:15 26314 user 16 0 828m 392m 36m S 99.9 10.4 0:49.95 java
19:09:18 26314 user 16 0 817m 398m 36m S 95.8 10.6 0:52.16 java
19:09:20 26314 user 16 0 817m 398m 36m S 51.9 10.6 0:54.20 java

with sar I never reach the 99,9% of CPU but with top I see this amount of
CPU in several times.

So, which is the true value of CPU usage? and why this differences?

thanks in advance

ESG
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



Relevant Pages

  • Re: %cpu differences between sar and top
    ... I have been investigating about this and I think that with top I don´t get ... the usage of the cpu but I get de % of the cpu of the process. ... With the command sar I get that the cpu usage es 35%, for example, ... java process is using the 80% of the 35% of the cpu usage, ...
    (RedHat)
  • Re: %cpu differences between sar and top
    ... I have one cpu with two cores. ... With the command sar I get that the cpu usage es 35%, for example, ... java process is using the 80% of the 35% of the cpu usage, ...
    (RedHat)
  • 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)
  • Re: 99-100% Explorer Processor Usage
    ... Looking at a third incident on a separate PC of 'explorer.exe' hitting ... and see if the CPU is bogged down without the client installed. ... CPU usage hits 99-100% even where the PC has the custom application ... The tool expressly indicates the 'parent'/root 'Windows Explorer' is ...
    (microsoft.public.windowsxp.general)
  • Re: Does a Repair Install Affect Performance?
    ... I suggest you try cCleaner. ... CPU shot up to 80%+ for about 12 seconds while it started. ... > IE, iTunes, Microsoft Antispyware and Process Explorer itself. ... >>>> Sometimes CPU usage spikes when lots of apps open, ...
    (microsoft.public.windowsxp.perform_maintain)