LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 05-09-2007, 11:08 AM   #1
ColinAnderson
LQ Newbie
 
Registered: Sep 2003
Distribution: RHEL 4, 5; Gentoo
Posts: 20

Rep: Reputation: 0
`top` Irregularities - cpu count, percentage, process lists


This morning one of our MySQL servers was getting hammered pretty hard. I pulled up top and noticed some irregularities between the data it was showing me, and the data that the System Monitor provided. This system has four Itanium2 processors and 16 gigs of memory.
  • The CPU usage from top was at ~20%.
  • The System Monitor shows two of the processors at 100%.
  • top only shows one CPU, but this machine has four.
  • top shows ~95% memory usage, but the System Monitor only shows 2 out of 16 gigs in use.
  • The mysqld process didn't even show up on top, though clearly it is the cause of the high CPU usage.

I've provided a couple of linked screenshots, as image attachments or in-line images don't seem to be allowed here.

Top:
http://personal.utulsa.edu/~colin-an...ebsite/top.png

System Monitor:
http://personal.utulsa.edu/~colin-an...te/sys_mon.png

Any ideas as to the inconsistencies? Like I said, I've run both as root for comparison purposes.
 
Old 05-09-2007, 11:26 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,487

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Pays to understand your tools - "man top". No point in comparing apples to oranges.

Top was showing you the average of the CPUs - hit the "1" key whilst it's active. I would suggest you set up a profile to include this - its mentioned in the man page.
As for memory, subtract the cached and buffered numbers from the (top) useage numbers and see what you get. I find "free -m" more useful for this bit - it does the math for you.
As for the last question, what shows after the (top) change ???.
 
Old 05-09-2007, 01:44 PM   #3
ColinAnderson
LQ Newbie
 
Registered: Sep 2003
Distribution: RHEL 4, 5; Gentoo
Posts: 20

Original Poster
Rep: Reputation: 0
I have read the man page several times, it still seems to do the same thing as most other system monitors.

The reason I'm curious about the CPU information is because I've long understood it as showing each CPU's status. Funny, I was using "l" instead of "1" ... which caused the confusion. Whoops.

Interesting bit about the memory, I didn't realize that's how it worked.

Running free -m, I get
Code:
[root@rh-mysql-prod cganders]# free -m
             total       used       free     shared    buffers     cached
Mem:         16203      16190         12          0        137      14025
-/+ buffers/cache:       2026      14176
Swap:         1983          0       1983
Which still says 16 of 16 GB of memory is in use. But I suppose subtracting the cached portion matches the 2GB that the System Monitor reports. I still don't like how that's labeled.

Last edited by ColinAnderson; 05-09-2007 at 01:46 PM.
 
Old 05-09-2007, 06:11 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,487

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Code:
             total       used       free     shared    buffers     cached
Mem:         16203      16190         12          0        137      14025
-/+ buffers/cache:       2026      14176      <=== note this line
 
Old 05-09-2007, 07:41 PM   #5
ColinAnderson
LQ Newbie
 
Registered: Sep 2003
Distribution: RHEL 4, 5; Gentoo
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks for the explanations syg00. I appreciate it.

.Colin
 
  


Reply

Tags
cpu, memory, mysql, redhat, top, usage


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
how to count the number of occurrences of a process beeblequix Linux - General 3 09-18-2006 05:17 PM
Hi Percentage of CPU usage in copying or writing large files kaplan71 Fedora 8 09-14-2006 05:02 PM
Calculating the percentage completion of a process sharathksin Programming 2 03-06-2006 02:44 AM
ps -aux CPU usage percentage depdiver Linux - General 1 02-25-2006 03:02 AM
find remaining percentage of cpu happy78 Programming 11 09-26-2005 09:02 PM


All times are GMT -5. The time now is 07:40 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration