NMON - a useful tool for Linux Performance Analysis

22
Nmon A USEFUL TOOL FOR LINUX PERFORMANCE ANALYSIS

description

NMON - a useful tool for Linux Performance Analysis

Transcript of NMON - a useful tool for Linux Performance Analysis

Nmon

NmonA Useful tool for Linux Performance AnalysisScopeTools for monitoring LinuxIntroduction to NmonIntroduction to Nmon AnalyzerAdvantages of using Nmon

Tool For Linux Monitoring System (Console)top/htop Linux Process Monitoringiotop - simple top-like I/O monitorvmstat -Virtual Memory Statisticssysstatsar: collects and reports system activity information.iostat: reports CPU utilization and disk I/O statistics.mpstat: reports global and per-processor statistics.pidstat: reports statistics for Linux tasks (processes).sadf: displays data collected by sar in various formats.

Tool For Linux Monitoring Network (Console)Tcpdump - Network Packet AnalyzerNetstat - Network StatisticsIptraf - Real Time IP LAN MonitoringIftop - Network Bandwidth MonitoringNethogs - Monitor Per Process Network BandwidthTool For Linux Monitoring Web basedMonit - Linux Process and Services MonitoringNtop Network MonitorZabbix - enterprise class Linux monitoring systemCacti Network Monitoring SoftwareMunin - Network/Server MonitoringNagios Network/Server Monitoring

Why Nmon?Simple, small and easy to useIt only requires the knowledge of one command to start the monitoring and data collection process.Once the data is collected, it is then formatted to produce graphs by another tool called nmon analyzer.

Information on one screen and dynamically updating it. (Interactive Mode)

Low CP usage (usually below 2% and below 1% in newer machines)

Designed for large machine (64 CPUs, 4000+ disks, 35,000 processes)

The same data to a text file for later analysis and graphing for reports, the output is in a spreadsheet format (.csv).

What is NMON?It is a systems administrator tool which can display the CPU, memory, network, disks (mini graphs or numbers), file systems, NFS, top processes, resources on diferents Linux distributions.Interactive mode and data collect modeInteractive mode: it uses curses for efficient screen handling, which updates the terminal frequently for real-time monitoring.Data collect mode: the data is saved to a file in CSV format for later processing and graphing. The file also includes important configuration details that are useful for recommending tuning.Interactive Mode

Interactive Mode

Data Collect ModeWhen you use nmon in data collect Mode it capture data into a file, We have to specify the -f option: spreadsheet output default output filename is _YYYYMMDD_HHMM.nmon -s option: seconds between snap shots -c option: number of snapshots before nmon stopsFor instance:nmon -f -s 30 -c 120This command will launch nmon in the background and take a snapshot every 30 seconds up to 120 times. This should be 60 minutes of data snapshots. More option for data collector mode are available throught nmon -hStopping nmon Data Collect ModeIf we want to stop nmon data collector, as the helps suggest, we can use:

kill -USR2

The nmon file will not be deleted, it will only stop nmon to collect dataNmon File contentWe are going to get a file with a content similar to:

CPU01,T0002,2.4,2.0,0.0,95.5CPU02,T0002,2.4,1.0,0.0,96.5CPU03,T0002,1.0,1.2,0.0,97.8CPU04,T0002,1.8,2.0,0.0,96.2CPU_ALL,T0002,2.0,1.5,0.1,96.5,,4MEM,T0002,1995.9,-0.0,-0.0,1022.0,371.2,-0.0,-0.0,923.9,-0.0,561.6,757.3,-1.0,21.5,26.5,665.0VM,T0002,-1,-1,-1,48,-1,-1,0,0,0,0,0,0,0,0,0,3576,3576,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0PROC,T0002,1.0,-1.0,1440.8,-1.0,-1.0,-1.0,2.6,-1.0,-1.0,-1.0NET,T0002,0.6,0.0,6.6,0.0,NETPACKET,T0002,7.0,0.0,8.4,0.0,JFSFILE,T0002,22.7,0.0,0.2,0.2,0.0,-nan,100.0DISKBUSY,T0002,0.2,0.2,0.0,0.0,0.0DISKREAD,T0002,0.0,0.0,0.0,0.0,0.0DISKWRITE,T0002,33.6,33.6,0.0,0.0,0.0DISKXFER,T0002,3.2,3.2,0.0,0.0,0.0DISKBSIZE,T0002,10.5,10.5,0.0,0.0,0.0

What is next?

Handling nmon File DataIf we want to open the nmon file in a regular spreadsheet program, we should probably sort the file first, as the nmon help file suggests

sort sample_file.nmon >stats.csv

Transfer the CSV file to your PC and open it with you regular spreadsheet programNOTE: The nmon analyser or consolidator does not need the file sorted.Nmon Analyzer the other half of NmonWhat does Nmon Analyzer do?Produces pregenerated charts for CPU, Memory, Network, Disk Produces charts for virtually all sections of nmon outputCan merge multiple nmon files FOR THE SAME SYSTEM to analyze longer periodWorks with Excel 2007 and 2010

Nmon Analyzer

Result of Nmon Analizer

ConclusionsNmon is a powerful tool that can increase the efficiency of analyzing performance Linux servers. It only requires the knowledge of one command to start the monitoring and data collection process. Once the data is collected, it is then formatted to produce graphs by another tool called nmon analyzer. The graphs produced provide systems administrators and performance engineers an easy to view representation of disk, memory and CPU utilization at different time intervals allowing them to analyze workload bottlenecks. Many Linux monitoring and performance tools exist, such as ps, top, free, vmstat, iostat, sar, and iptraf. These individual tools probably produce more detailed and granular data for the specific service or subsystem you're trying to capture performance data on. But with nmon, you'll see a very nice single screen showing many aspects of a running Linux system. It migth not be very useful for daily basis monitoringMore info can be found atNMON Homepagehttp://www.ibm.com/developerworks/aix/library/au-analyze_aix/NMON Analyzerhttp://www.ibm.com/developerworks/aix/library/au-nmon_analyser/

Questions?