LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-19-2009, 12:01 AM   #1
makam.sreekanth
LQ Newbie
 
Registered: Jun 2008
Posts: 15

Rep: Reputation: 0
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?
 
Old 03-19-2009, 11:28 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,960

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by makam.sreekanth View Post
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....
 
Old 03-19-2009, 05:44 PM   #3
palisetty_suman
Member
 
Registered: Feb 2007
Location: TX, USA
Distribution: fedora
Posts: 191

Rep: Reputation: 33
Thumbs up 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.
 
Old 03-19-2009, 08:20 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by palisetty_suman View Post
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
 
Old 03-19-2009, 09:18 PM   #5
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Rep: Reputation: 34
Quote:
Originally Posted by makam.sreekanth View Post
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.
 
Old 03-20-2009, 09:52 AM   #6
makam.sreekanth
LQ Newbie
 
Registered: Jun 2008
Posts: 15

Original Poster
Rep: Reputation: 0
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?
 
Old 03-20-2009, 10:39 AM   #7
ddaemonunics
Member
 
Registered: May 2008
Location: Romania
Distribution: Debian
Posts: 242

Rep: Reputation: 41
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..

Last edited by ddaemonunics; 03-20-2009 at 10:40 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux desktop GUI tool for CPU utilization and bandwidth utilization karimasif Linux - Software 4 03-03-2008 02:09 PM
Question on top, ps and sar output Sathya Linux - Newbie 3 10-19-2007 01:58 AM
Conflicting data from sar & top clindo Red Hat 0 05-15-2007 10:20 AM
high cpu utilization 'top' analysis saarb16 Linux - General 2 03-09-2006 10:58 AM


All times are GMT -5. The time now is 01:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration