Click to See Complete Forum and Search --> : 'top' is using 97% of my server cpu -- ruh roh!


Floog
08-11-2003, 12:57 PM
This is puzzling and I'm worried that my Samba server machine may be about to do a face-plant.

I had a user who was having difficulty logging on and accessing some samba shares. Long story, short: in checking things out on the server-side, I ran 'top' and saw that none of the running daemons were hitting the Pentium III 1 Ghz CPU for more than 1%-2%, except for 'top'. 'top' is currently using 95% - 97% of the CPU.

I can't figure this out, as I've been in the habit of letting top run for an hour or so, here and there, and I've never seen it push the CPU like this.

Another thing that looks very odd is that the time-stamp indicates that top has been running for 5040 minutes (or 84 hours), which is not anywhere near accurate.

I did ~$killall top just to make sure it was not running on any other virtual consoles I had missed or forgotten. I then ran top again and it was still using the same percnentage of cpu.

What may be happening to my machine? What other testing can I do to see if the chip is okay? I've got about 25 users on the server right now and nobody has complained of anything not running as usual, except for this one fellow.

Please help if you have a moment. I appreciate your time and patience.

Floog

je_fro
08-11-2003, 01:01 PM
I've seen that before and it was 2 instances of top running at the same time. Maybe try (in addition):
killall -9 top
?

Floog
08-11-2003, 02:27 PM
ahhhh, very well done Mr. Je_Fro!
I'm back down to 0.2% - 0.3% running top.

Thanks for the pointer. I guess my repeated killalls didn't hit all sub/child processes.

Thanks for your time and help.

Floog


Originally posted by je_fro
I've seen that before and it was 2 instances of top running at the same time. Maybe try (in addition):
killall -9 top
?

bwkaz
08-12-2003, 06:55 PM
Your top process may have just been in an infinite loop with SIGTERM disabled. Or, it may have gotten stuck in an infinite loop after catching a SIGTERM signal.

(killall and kill both send a SIGTERM by default, which can be caught, and can be ignored. killall -9 and kill -9, OTOH, send a SIGKILL, which cannot be caught and cannot be ignored -- as long as your kernel is working correctly, the process WILL get killed. Its parent process may not call wait() on it for a while, which means it might show up as a zombie, but it won't be able to take up any more CPU at least. ;))

Floog
08-13-2003, 08:00 AM
Thanks for the reply, bwkaz.

Your post has been pasted into my ever-expanding sysadmin rescue notebook.

You're practically immortal now. :-)

But seriously, thanks for the explanation. Good fundamentals that I need to know.

Best regards,

Floog

Originally posted by bwkaz
Your top process may have just been in an infinite loop with SIGTERM disabled. Or, it may have gotten stuck in an infinite loop after catching a SIGTERM signal.

(killall and kill both send a SIGTERM by default, which can be caught, and can be ignored. killall -9 and kill -9, OTOH, send a SIGKILL, which cannot be caught and cannot be ignored -- as long as your kernel is working correctly, the process WILL get killed. Its parent process may not call wait() on it for a while, which means it might show up as a zombie, but it won't be able to take up any more CPU at least. ;))