July 1, 2010

6 Command Line Tools for Linux Performance Monitoring

So you need to monitor a Linux system for performance metrics... CPU, Memory, Network, Disk, etc.

Here are 6 of my favorite command line tools for monitoring a Linux system from the command line.


htop

http://htop.sourceforge.net/
dstat

http://dag.wieers.com/home-made/dstat/
bmon

http://freshmeat.net/projects/bmon/
iftop

http://www.ex-parrot.com/pdw/iftop/
ifstat

http://gael.roualland.free.fr/ifstat/
sysstat
this is a package of utilites including iostat, mpstat, sar, and others.

http://pagesperso-orange.fr/sebastien.godard/

These tools are all available from package managers (apt-get, yum, etc) on most Linux systems. They are also available on most other *nix platforms.

9 comments:

Yossarian UK said...

The best tool to see what user is creating the most IO usage is iotop -

http://guichaz.free.fr/iotop/

This will work on most modern distros - i.e NOT Centos - you would need to compile a (non ancient) kernel (2.6.20+) and also compile a new version of python.

George Marselis said...

what do five out of six of those commands have in common?

a non-parsable output. that's what.

spif said...

You forgot atop which is sort of like a cross between sar and top. It allows you to collect data in a log file and then review it in a top-like interface.

Anonymous said...

He's back, and alive!

Unknown said...

Shameless self-promotion: nethogs (http://nethogs.sf.net) would have fit in nicely in this list.

Unknown said...

The most useful article. Let me add my two favorites to the list:

saidar
http://www.i-scream.org/libstatgrab/

mytop
http://jeremy.zawodny.com/mysql/mytop/

Dag Wieers said...

@George Marselis: Dstat does have parsable output if you specify the --output option. You can create graphs and have more detailed information inside the CSV output than you have on screen.

Mark Seger said...

re parsable output - I guess you haven't tried collectl yet. It's basicially a combination of just about any tool you can think of, plus more. Think sar + *stat + *top + etc and then add in lustre and infiniband. It can produce timestamped data (a minimum requirement for plotting) as well as delimiter separated data for each of plotting either with excel, gnuplot, etc OR colplot which is also on sourceforge.

As a side benefit it can log as sub-second inetvals and uses < 0.1% of the CPU when recording everyting at 10 second intervals. Of course it only record process/slab data at 60 second intervals since those are heavier weight options.

Some of the largest clusters in the world use collectl every day...

-mark

Igors said...

yes, nethogs is a nice utility to measure network speed or amount of data sent/received by a Process/Program Name. that was quite useful in a project where i was involved.