Operating System - Linux
1829863 Members
2186 Online
109993 Solutions
New Discussion

Re: Reading "top" in RH 8

 
SOLVED
Go to solution
tpfraz
Advisor

Reading "top" in RH 8

Hello, I'm having some problems reading the information that the top command displays. I have two 2.4Ghz Xeon processors in a RH 8 machine. top displays four processors: CPU0, CPU1, CPU2, CPU3. I understand that CPU0,1 are one processor and CPU2,3 are the other. How do I read the info when all 4 processors shown display different results? (4 different sets of data for only 2 different processors).
Also, the sum of the percentage of processor usage does not add up. For example I have a process that says it's using 99.9% of cpu, another using 22.1%, another using 19.5%. How do I make sense of this when it obviously doesn't add up to 100%

#2) The amount of memory used does not add up either. It says that there is constantly about 950M of 1000M of mem being used. But when looking at mem usage for all processes it only adds up to 500 - 600M at most.
Any ideas??

Thanks...
7 REPLIES 7
Balaji N
Honored Contributor

Re: Reading "top" in RH 8

hey
am confused. u have a two processor machine and top shows four processor. how did linux add two processor by itself.

can you paste the output of /proc/cpuinfo. also, can u paste the initial header of the command top where it dispalys these info.

and regarding mem, can u pls provide more info. i dont understand.

hth
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Tony Contratto
Respected Contributor
Solution

Re: Reading "top" in RH 8

The 2 processors showing up as 4 in top and /proc/cpuinfo is correct. The new Xeon processors have a new feature called hyperthreading that makes each processor show up as 2 processors.

On processor usage: if you have multiple processors in a system you can have N*100% processor utilization. In a system with 4 processors you could have 4 different processes that each take up 100% of 1 cpu for a total of 400% processor utilization.

On memory usage: The memory used will show that pretty much all of your memory is used at any given time, but some of that memory is probably not being used for applications that are running. The portion of memory that is not required for any currently running processes is used as a buffer cache.

--
Tony
got root?
tpfraz
Advisor

Re: Reading "top" in RH 8

Thanks Tony,
That cleared a few things up.
So on my system with 2 processors but displaying 4 processors, would I have 200% or 400% available?
If the answer to the above is 200%, how would I read the 4 different percentage stats?
Thanks...
Tony Contratto
Respected Contributor

Re: Reading "top" in RH 8

To be honest, I'm not sure. I don't personally have a system with the new processors in it (wish I did... :). The information in my previous post is from what I have read/heard about them.

Since you "see" 4 CPUs, I would assume that you would have the potential of seeing 4 processes in top, each using 100% cpu, for a total of 400% utilization.


Someone correct me if I'm wrong...

--
Tony
got root?
John Poff
Honored Contributor

Re: Reading "top" in RH 8

Hi,

That sounds right. I have several IBM boxes with the dual Xeon processors and my top shows up the same way. Here is part of the screen shot from 'top' on one of them:

5:21pm up 8 days, 7:43, 2 users, load average: 1.69, 0.37, 0.12
80 processes: 79 sleeping, 1 running, 0 zombie, 0 stopped
CPU0 states: 0.0% user, 0.2% system, 0.0% nice, 99.3% idle
CPU1 states: 0.5% user, 2.2% system, 0.0% nice, 96.2% idle
CPU2 states: 1.0% user, 3.3% system, 0.0% nice, 95.0% idle
CPU3 states: 1.1% user, 2.3% system, 0.0% nice, 95.4% idle
Mem: 8230824K av, 8208304K used, 22520K free, 0K shrd, 213816K buff
Swap: 3121256K av, 0K used, 3121256K free 1542372K cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
1839 root 15 0 624 624 488 D 2.3 0.0 0:00 find
1842 root 15 0 620 620 488 D 1.7 0.0 0:00 find
1845 root 15 0 620 620 488 D 1.7 0.0 0:00 find
1840 root 15 0 620 620 488 D 1.5 0.0 0:00 find
1838 root 15 0 620 620 488 D 1.3 0.0 0:00 find
1841 root 15 0 620 620 488 D 1.1 0.0 0:00 find
1843 root 15 0 620 620 488 D 0.9 0.0 0:00 find
1844 root 15 0 620 620 488 D 0.9 0.0 0:00 find


I ran eight 'find' processes at a time and it barely made each of the CPUs break a sweat. If you can think of something that will exercise it harder I'll give it a try just to see what happens. I love this stuff!

As for the memory, you might be using some in shared memory? We are playing with Oracle 9.2 on it and the newer version of Oracle uses shared memory differently than what it used to. We've set aside about 5 Gb for the SGA, but when our DBA fires up Oracle it only uses around 350 Mb. He read that Oracle reserves what you give it for shared memory but only actually uses it as it is needed. So from my 'top' you see 8 Gb of RAM that is almost all used, but Oracle is really only grabbing a small part of it.

JP
tpfraz
Advisor

Re: Reading "top" in RH 8

Thank you very much everyone.
I think I have a better grasp on this now.

John, we are hosting a few online games,
Jedi Knight 2.
These seem to put a pretty nice dent in the resources if you're looking for something to test your systems.

Thanks again...
Tony Contratto
Respected Contributor

Re: Reading "top" in RH 8

John,

Running a kernel build with something like "make -j 12" should put a pretty good CPU load on it. :)

--
Tony
got root?