LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-06-2013, 03:07 AM   #1
jeff.xue
LQ Newbie
 
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
some problem of using the top command


i have wirte some script to monitor some process and record the data.
but when i run my script that i found the record of the CPU whitch is over 100% .For example:

the %CPU = 577.3 ,i don't know how to conver to the real value.

PID USER PR NI VIRT RES SHR S %CPU %ME MTIME+ COMMAND
16280 wacos 20 0 10.7g 2.3g 12m S 577.3 7.3 42:00.41 java

PS: running in redhat6.2 (i have runned the same script in solaris ,which is normal)

Last edited by jeff.xue; 02-06-2013 at 03:08 AM.
 
Old 02-06-2013, 03:23 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
That implies you have multiple threads running on multiple cores.

RHEL comes with sysstat - you might be better served to make use of that. See "man sar".
 
1 members found this post helpful.
Old 02-06-2013, 03:28 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Out of the box top shows a cumulative value for the total of cpu's (if one has 2 core's/cpu's running each at 90 procent the value shown will be 180%).

Use 1 when running top to show value's for each separate cpu. If you want to make this the default behaviour press W enter to create a configuration file.

Top might not be the best choice to use when used in a script. sar comes to mind.
 
1 members found this post helpful.
  


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
LXer: Can You Top This? 15 Practical Linux Top Command Examples LXer Syndicated Linux News 0 01-09-2010 09:42 PM
Finding the top CPU-using processes? "top" command does not help... catalytical Linux - Server 1 04-06-2009 04:50 PM
top command maooah Solaris / OpenSolaris 17 08-17-2008 07:43 PM
problem with output of ' top -n 1 ' command NoopurTiwari Linux - Newbie 1 05-29-2007 02:45 AM
top command ram problem displaying negative value for process xekhz Linux - General 1 06-10-2006 03:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:29 AM.

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
Open Source Consulting | Domain Registration