Home > linux > Why do the CPU stats vary with ps and top?

Why do the CPU stats vary with ps and top?

February 29th, 2008 Leave a comment Go to comments

via redhatmagazine.com

The commands ps and top express CPU time differently. While ps calculates it by “total CPU time” divided by “time task is running”, top shows the value as a percentage of overall CPU time. For ps, this means that the longer a process is running without a high CPU utilization the smaller the value of %cpugets (it converges to zero). For top, this means that it displays this value as share of the CPU time since last screen update and is therefore more accurate in terms of “current CPU utilization”.

more …

Categories: linux Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.