LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-10-2012, 07:54 AM   #1
vasanth.v999
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Rep: Reputation: Disabled
how to find all processes cpu utilization & the cpu processor in linux?


I need a command to list all the processes running in a server and its cpu utilization and the respective processor it uses (means cpu 0/cpu1) in a linux server running redhat-release 5update 2 .

Can you please help me if there is a command to do or is there any script which can help ?
 
Old 01-10-2012, 08:05 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,019

Rep: Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275
Quote:
Originally Posted by vasanth.v999 View Post
I need a command to list all the processes running in a server
ps aux
Quote:
Originally Posted by vasanth.v999 View Post
and its cpu utilization and the respective processor it uses (means cpu 0/cpu1)
top then use fj to add the last processor column.
 
Old 01-10-2012, 08:08 AM   #3
Janus_Hyperion
Member
 
Registered: Mar 2011
Location: /
Distribution: Fedora (typically latest release or development release)
Posts: 372

Rep: Reputation: Disabled
As an addition to the previous post, you can use htop (you might have to install it). It functions the same way as 'top' but lets you interact with the output.
 
Old 01-10-2012, 08:11 AM   #4
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
one more tool is there you might wanna try
Code:
#vmstat
Apart from these you can always look for additional tools freely available on internet to get update on CPU and memory utilization like the one which I use are

collectl, vnstat etc
 
Old 01-10-2012, 08:35 AM   #5
vasanth.v999
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi All,

Thanks for all suggestion !

Couple of queries!

TenTenths: How can i add the cpu number when i am executing the top in batch mode ?

deep27ak : How can i fetch the same data from collectl ? I tried a lot but could not successful .


i am trying to fetch below data exactly to prepare a report .

"process" "process utilization" & "processor it used or previous used processor"
 
Old 01-10-2012, 08:40 AM   #6
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by vasanth.v999 View Post
Hi All,

Thanks for all suggestion !

Couple of queries!

TenTenths: How can i add the cpu number when i am executing the top in batch mode ?

deep27ak : How can i fetch the same data from collectl ? I tried a lot but could not successful .


i am trying to fetch below data exactly to prepare a report .

"process" "process utilization" & "processor it used or previous used processor"
I don't get the meaning of fetching same data?
Code:
if you want to view or prepare a report on process --->top command can be used
for processor utilization -------> top (shift+p)
the options which I gave you were additional

Code:
collectl
this gives you the current running processor speed, network and hard disk usage
go through this link for further help

Getting started using collectl
 
1 members found this post helpful.
Old 01-10-2012, 08:41 AM   #7
dboth
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Rep: Reputation: 0
I always start with top. It is an interactive tool and can show the top CPU users in time periods down to fractions of a second. You can add columns and it can show which CPus are getting the most usage, but it cannot show which CPU a particular task is assigned to; you should be able to infer that for tasks taking large amounts of CPU time.

I use SAR (System Activity Reporter) for long-term analysis of CPU usage, as well as many other system resource statistics. Install the sysstat package (for Fedora and RHEL related distros). SAR begins collecting data and stores it in ten-minute intervals over a five-day period so you can analyze data over long term.

I know this does not help with specific processes, but SAR is a powerful tool and can help you determine whether a performance problem is CPU, I/O or Network related.
 
Old 01-10-2012, 09:43 AM   #8
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,019

Rep: Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275Reputation: 1275
Quote:
Originally Posted by vasanth.v999 View Post
TenTenths: How can i add the cpu number when i am executing the top in batch mode ?
ps is better for batch mode, and you can over-ride the format and add extra columns, man ps for more info, it's the psr column that shows the last processor.
 
  


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
High CPU utilization on only one CPU out of 4 CPUs makam.sreekanth Linux - Kernel 2 09-03-2009 05:12 AM
Linux desktop GUI tool for CPU utilization and bandwidth utilization karimasif Linux - Software 4 03-03-2008 02:09 PM
How to measure and get CPU & I/O utilization? 3ttt Linux - Newbie 2 05-22-2007 06:05 AM
LXer: How do I find out Linux CPU utilization? LXer Syndicated Linux News 0 01-14-2007 10:03 AM
CPU & memory utilization rgerhards Linux - Newbie 2 12-03-2003 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:55 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