LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   top, ps, sar which gives accurate data for CPU utilization (https://www.linuxquestions.org/questions/linux-newbie-8/top-ps-sar-which-gives-accurate-data-for-cpu-utilization-712688/)

makam.sreekanth 03-18-2009 11:01 PM

top, ps, sar which gives accurate data for CPU utilization
 
Hi,

I use 3 commands top, sar and ps to monitor the thread wise CPU utilization for a process. Each one gives different data for me.

Please let me know which is the accurate one and why?

TB0ne 03-19-2009 10:28 AM

Quote:

Originally Posted by makam.sreekanth (Post 3480217)
Hi,

I use 3 commands top, sar and ps to monitor the thread wise CPU utilization for a process. Each one gives different data for me.

Please let me know which is the accurate one and why?

They're all accurate...and they all do different things. And this sounds like a homework question to me....

palisetty_suman 03-19-2009 04:44 PM

hi
 
Hi top is the best command where you get lot of details compared to the rest. All of them are accurate.

All the best.

Tinkster 03-19-2009 07:20 PM

Quote:

Originally Posted by palisetty_suman (Post 3481266)
Hi top is the best command where you get lot of details compared to the rest.

Sorry, but that's a silly statement ...

Maybe top does in most cases what YOU want. But that doesn't
mean that it's the best of the tools. That's like saying a
hammer is better than a screwdriver or pliers.

It is if you're in the process of getting nails into wood.
For screws & metal the hammer is a poor choice.



Cheers,
Tink

ic_torres 03-19-2009 08:18 PM

Quote:

Originally Posted by makam.sreekanth (Post 3480217)
Hi,

I use 3 commands top, sar and ps to monitor the thread wise CPU utilization for a process. Each one gives different data for me.

Please let me know which is the accurate one and why?


you can use the 3 commands at the same time as for comparing the values of the CPU. .. all are useful. :)

makam.sreekanth 03-20-2009 08:52 AM

Here I am just interested on CPU usage and no other options the tool provides.

I heard that ps, top and sar the way they collect the data are totally different. Are anybody aware of this? can some body point to the docs which talks about internals of these commands rather than usage?

ddaemonunics 03-20-2009 09:39 AM

They give the same info
the problem is knowing how to read and interpret that data

I can point you to a book
Optimizing Linux® Performance: A Hands-On Guide to Linux® Performance Tools

nice book..


All times are GMT -5. The time now is 04:45 AM.