Linux top commands
March 25th, 2009 by alex
This issue is dedicated to tops. Linux tops, the tops I recommend you get to know. They are:
- iotop (disk i/o) – Ever wondered why your hard drive is thrashing when all you are doing is reading a wikipedia page? Run this top and it will tell you what program is the offender.
- powertop (power consumption) – Laptop battery is draining awfully fast? This top is great at telling what is causing the most CPU wakeups, causing it to waste precious energy.
- iftop (network load) – give it an interface name and you got a quick glance at why your network light is blinking furiously. It won’t tell you which app is doing it but it will tell you where on the internet it is going the most.
- top (cpu,mem,swap) – well, this little guy needs no explanation. It’s the father of all top commands, displaying cpu and memory usage statistics per process.
- htop (cpu,mem,swap) – is top‘s big bretheren. It gives you bar-graphs of CPU, memory and swap, you can scroll through the processes and manipulate them in the curses interface.
- ntop (network) - a very heavy weight network monitor and analyzer. It runs in the background and displays a lot of network statistics via a local web interface
- apachetop (apache) – various statistics for monitoring you web server’s performance
- kerneltop, latencytop (kernel) – tops for kernel activity monitoring.
- mtop, mytop and ptop (database) – tops for mysql and postgress database monitoring.
- xrestop (gui) – x11 utilization monitor
- atop (cpu,memory,i/o,network) - this one tops it all. It’s got it all, network, memory, cpu… consider it top, iftop, and iotop combined in one place. And it does get a bit crowded in there. With a help of the kernel patch atop can correlate hardware resources to the processes, something only things like lsof and clever scripting can do.
And BTW all these tops, including atop’s kernel patch, are in the Ubuntu repositories, ready to be apt-get‘ten. (or apt-gotten, if you so desire)
Now I stop.