[PLUG] Top is lying

Rogan Creswick creswick at gmail.com
Fri Feb 12 17:09:53 UTC 2010


On Thu, Feb 11, 2010 at 8:32 PM, John Jason Jordan <johnxj at comcast.net> wrote:
>
> [jjj at Devil8 ~]$ ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
> %CPU   PID USER     COMMAND
> 99.0 25327 root     top
> <remainder deleted>
>
> So I killed top, then re-ran the command. It still listed top as 99%.
> WTH?
>

There may well be another instance of top running that isn't visible anymore.

you can use ps to take a look:

$ ps -ef | grep top
creswick 21082     1  0 Feb11 ?        00:00:07 top

That tells you the process id (the first number in the line: 21082).
With that, you can kill it:

$ kill 21082

or, if you want to skipp the grepping, just kill all instances of top:

$ killall 21082

If top *still* doesn't go away (check with ps -ef | grep... and the
other ps trick that shows processor usage), you can kill it more
forcefully.

$ kill -9 <process id of top>

Please note that using -9 is *not* a good thing to do -- it's a last
resort, and you really don't want to do this to programs that access
data.  There are other ways to kill things that are better, but I've
never been able to remember them....  (this is also why I don't run
any critical servers....).

--Rogan



>>I just found out just now based on this query to the list about
>>something called mpstat which will display each processors utilization
>>on the command line.
>>
>>http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html
>
> Evidently mpstat, iostat, and sar are not installed and not in the
> Fedora 11 repos. I didn't look around to see if I could find an RPM for
> them somewhere.
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>



More information about the PLUG mailing list