LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 07-16-2008, 06:34 AM   #1
mike.duffy
LQ Newbie
 
Registered: Jun 2008
Posts: 2

Rep: Reputation: 0
How does ps report CPU on a quad core server?


Good morning,

Runnind redhat 2.6.18-92.el5.

Using command ps -eo pid,pcpu,args | grep PROCESS_NAME

To get the CPU usage for the named process.

Does anyone know if this is returned as a percent of the whole system's CPU or as a percent of the cpu the process is running in?

Thanks in advance.
 
Old 07-16-2008, 06:57 AM   #2
murugesan
Member
 
Registered: May 2003
Posts: 151

Rep: Reputation: 28
The following command
ps -eo pid,pcpu,args
will display the details as:
PID CPU Percentage the process command
Example for the following command:
$ ps -eo pid,pcpu,args | head -n 6
PID %CPU COMMAND
1 0.0 init
2 0.0 [migration/0]
3 0.0 [migration/1]
4 0.0 [migration/2]
5 0.0 [migration/3]
This will list for all the process and the output is redirected as input to head command.
From the head command the first six lines needs to be displayed.
Similarly the command:
ps -eo pid,pcpu,args | grep PROCESS_NAME
will do:
first)
Display for all the process
the output will be redirected to grep command
second)
Display the line containing the name(using grep command) "PROCESS_NAME", if that process (PROCESS_NAME) running.
 
Old 07-17-2008, 02:53 AM   #3
mike.duffy
LQ Newbie
 
Registered: Jun 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the info but that is not what I am asking. I would like to know if the returned CPU percent is a percentage of the whole CPU of the server of of the actual core the process is running in.

Thanks
 
Old 07-17-2008, 02:55 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
The latter - normalized metrics aren't that useful usually.
 
  


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
Fedora Core 6 on Xeon Quad Core baddah Fedora 3 11-18-2007 10:09 AM
LXer: Intel Core 2 Extreme Quad-Core QX9650 LXer Syndicated Linux News 0 10-29-2007 08:50 PM
Fedora Core 6 - Support for Quad Core Xeon baddah Linux - Hardware 1 09-20-2007 06:20 PM
When will AMD new quad core CPU be on retail market satimis General 1 09-18-2007 09:13 AM
Will a 32-bit OS be able to handle 32GB of memory on a quad dual-CPU system? theitguy Linux - Hardware 3 07-27-2006 05:31 PM


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