I have recently discovered this awesome tool that collects, analyzes and reports system performance information on Linux and AIX operating systems – called nmon. The tool was actually developed in 2009 and has made my life so much easier, so I thought I’d write about it.

nmon provides CPU utilization, kernel-level values, memory and disk usage, and network information. The tool can display this data neatly and in real-time directly in your console, or it can save the data to a csv file that can be read into MS Excel using the nmon analyzer tool. To save nmon data to a csv file, run:

nmon -F <outfile>.nmon -t -s <interval time> -c <# intervals>

I have been using nmon extensively to analyze the performance and identify any bottlenecks in my database system. Basically, my setup involves 2 machines – a database server where a DB2 instance exists, and a client server that hosts a number of application processes that update and retrieve data from the database server.

The first thing I notice from the nmon output on the client server is that my CPU is pegged pretty close to 100%. This is good as it means I’m efficiently using all my CPU, but it will quickly become a bottleneck if I want to scale out and add more clients to my applications.

I then look at the nmon output from my database server – the “DISKBUSY” worksheet – and see that my DB2 tablespace disks are getting pummeled. To fix this, I need to either cache more data in-memory, or increase the number of disk spindles.

Finally, I notice from the “NET” worksheet that I’m utilizing my entire network bandwidth as my database server is sending 100MB/s to the client server. Even if I add more disks to the database server and more computing power on the client server, my system will always be constrained by my network bandwidth. Clearly this is the greatest bottleneck in my system and I need to either increase my network bandwidth or decrease the amount of chatter between the client and server machines.

Using a few of the simplest features of nmon, I have already identified 3 performance bottlenecks in my system. nmon also displays individual process information, virtual memory usage, and CPU core information. I highly recommend this tool for any system administrator or performance analyst looking to easily gather and report system usage information.

You can download the nmon tool and its documentation at nmon.sourceforge.net.