In my CentOS server, when I check the resources with sar command, user cpu usage is around %15 while in top command the sole 'java' process uses like %99 of cpu. sometimes it's even goes further than %100! who's lying here?
Asked
Active
Viewed 4,950 times
1 Answers
1
Neither -- they're just giving a different idea of CPU usage.
Top's idea of CPU is "per-core" -- that is, "this program is using 100% of one core". A multithreaded program can, therefore, be using, say, "400% CPU" -- which makes the eyes water a little sometimes.
On the other hand, sar
sees it as as a percentage of total CPU -- so on a 4 core system, one fully utilised CPU core will show as "25% CPU", and the 400%-using program will show as 100%.
There's also the issue of instantaneous vs long-term averages, but I'm going to assume that you've accounted for that.

womble
- 96,255
- 29
- 175
- 230
-
Thanks for the answer buddy, that was my guess too. I actually have considered long-term averages and the interval was set to 1 sec. – SJ.Jafari Aug 15 '11 at 15:23