We noticed a significant different between the "percentage CPU" reported by TOP for a process (a Java instance of Tomcat) and that reported by issuing "ps -o pid,pcpu <process-id>". TOP indicated that the process was using 99% CPU, but "ps" just showed it using 40%.
I have google and googled, read the man/info pages - but cannot find any explanation for how they each arrive at their figures.
Any ideas or explanations are appreciated/welcome.
On Wednesday 24 August 2005 1:38 am, Richard Mixon (qwest) wrote:
the top(1) command uses a sample and measures the percentage of elapsed CPU
time between samples. PS is a single sample where percentage of CPU time is
expressed in a ratio between "CPU time used divided by the
time the process has been running".
--
Jerry Feldman