LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   `top` Irregularities - cpu count, percentage, process lists (https://www.linuxquestions.org/questions/linux-software-2/%60top%60-irregularities-cpu-count-percentage-process-lists-552616/)

ColinAnderson 05-09-2007 10:08 AM

`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.

syg00 05-09-2007 10:26 AM

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 ???.

ColinAnderson 05-09-2007 12:44 PM

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. :p

syg00 05-09-2007 05:11 PM

Code:

            total      used      free    shared    buffers    cached
Mem:        16203      16190        12          0        137      14025
-/+ buffers/cache:      2026      14176      <=== note this line


ColinAnderson 05-09-2007 06:41 PM

Thanks for the explanations syg00. I appreciate it.

.Colin


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