-   Linux - Server (
-   -   Help me understand my top output (

neocontrol 02-21-2008 04:31 PM

Help me understand my top output

top - 15:26:25 up 364 days,  8:10,  2 users,  load average: 0.12, 0.13, 0.15
Tasks:  69 total,  2 running,  67 sleeping,  0 stopped,  0 zombie
Cpu0  :  8.3% us,  0.0% sy,  0.0% ni, 91.7% id,  0.0% wa,  0.0% hi,  0.0% si
Cpu1  :  4.0% us,  4.0% sy,  0.0% ni, 92.0% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:  4045224k total,  4027540k used,    17684k free,    24240k buffers
Swap:  2048276k total,      144k used,  2048132k free,  3654836k cached

 9220 mysql    16  0  610m 169m 4632 S    8  4.3  2363:47 mysqld
    1 root      16  0  4756  516  428 S    0  0.0  0:17.24 init

Not to sure what some of the process output is about. Like NI, VIRT, RES, SHR.

Also I noticed that this machine is sucking up nearly all my ram... Which i hear is how Linux is supposed to be. But 4GB? That seems excessive to me.

My real problem relates to that mysqld process. This is off of my mysql machine, and it's running SLLOOOWWWWWW. The machines only responsibilities is running mysql. But runs slow when memory dips low to the point of 15mb or so left.

As you notice, there is almost a full year on the clock, and we've restarted mysql once, about 6 months ago when it was doing the same things.

Memory leak? Possible misconfiguration somewhere?


pljvaldez 02-21-2008 04:47 PM

What is the output of free -lm? It maybe that there's plenty of RAM left for mysqld. From your top output, it looks like only 4.3% of memory is used by mysqld...

neocontrol 02-21-2008 04:49 PM


            total      used      free    shared    buffers    cached
Mem:          3950      3932        18          0        26      3565
Low:          3950      3932        18
High:            0          0          0
-/+ buffers/cache:        339      3610
Swap:        2000          0      2000

I was thinking that there wasn't that much consumed by mysqld, but the fact that the machine is slow where my websites stop, has me very concerned.

pljvaldez 02-21-2008 04:59 PM

If you look at the line that's -/+ buffers/cache: it shows that your applications are using 339MB and that 3.6 GB is free for application use. Your swap is also not being used at all for applications.

The first line basically shows that 3.6 GB is being used to cache data. If you needed it for applications (like starting another daemon or whatever), it would free up some of that cache for your applications.

Now as to your slowdown, I don't have any good educated guesses. Maybe some problem with your cached data?

neocontrol 02-21-2008 05:25 PM

Thanks, that at least crosses off one thing I thought was wrong.

chrism01 02-21-2008 06:46 PM

It's difficult to say, but it might be purely a DB issue.
Are there a lot of mysql process showing when you run top?

Try logging into mysql and running the following :

show processlist;
show variables;

should give you something to work on.

All times are GMT -5. The time now is 02:49 PM.