Master Linux Performance Monitoring with nmon: Real‑Time & Scheduled Insights
nmon is a lightweight Linux tool that collects and displays real‑time CPU, memory, disk, and network metrics on a single screen, offers background data collection with customizable intervals, and generates analysis files that can be visualized using nmon_analyser for detailed performance reporting.
nmon is a Linux performance data collection and analysis tool that is simple to use.
What nmon Can Do
It provides monitoring and analysis of various system performance data, including:
CPU usage
Memory usage
Kernel statistics and run‑queue information
Disk I/O speed, transfer rates, and read/write ratios
Available space in file systems
Network I/O speed, transfer rates, and read/write ratios
Processes consuming the most resources
How to Use nmon
Real‑time Monitoring
Run nmon interactively and use shortcut keys to display the metrics you care about, for example:
Press C – view CPU information
Press D – view disk information
Press T – view process information
Press M – view memory information
Press N – view network information
Press H for help on all shortcuts. This mode updates continuously, giving an at‑a‑glance view of system load, CPU utilization, memory consumption, network traffic, and disk activity.
Background Monitoring
To record resource usage over time for later analysis, run nmon in background mode, for example: ./nmon -f -s 10 -c 360 Options: -f: output file name in standard format _YYYYMMDD_HHMM.nmon -s: sampling interval in seconds -c: number of samples to collect
In the example, data is collected every 10 seconds for 360 samples, resulting in a one‑hour monitoring period.
Combined with a cron job, you can schedule regular monitoring, e.g.: 0 8 * * * /nmon -f -s 30 -c 1200 This runs every day at 08:00, sampling every 30 seconds for 1,200 samples (approximately 10 hours).
Analyzing nmon Results
Background or scheduled monitoring produces .nmon files that record system resource data. These files can be processed with the dedicated analysis tool nmon_analyser, which converts them to Excel spreadsheets and generates charts for visual interpretation of system performance.
Java High-Performance Architecture
Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
