Operations 4 min read

Master Linux Performance Monitoring: nmon, perf, top, iostat, sar, dstat & htop

This guide introduces several Linux performance monitoring tools—nmon, perf, top, iostat, sar, dstat, and htop—explaining their functions, key metrics, and installation commands for use on a Huawei Kunpeng server. It also shows how to generate flame graphs with perf and highlights htop's interactive advantages.

Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Master Linux Performance Monitoring: nmon, perf, top, iostat, sar, dstat & htop

Overview

Using a Huawei Kunpeng server, you can monitor system performance with several Linux tools.

1. nmon

Collects CPU, disk, network, memory usage over a period.

2. perf

Built‑in Linux kernel tool that captures per‑process call information and CPU consumption, and can generate flame graphs.

Flame‑graph generation steps:

Trace the system to obtain profiling data.

Use a script to draw the graph.

git clone https://github.com/brendangregg/FlameGraph

3. top

Monitors processes and overall CPU/memory usage, showing per‑CPU core utilization.

Typical fields displayed:

Load: time, logged‑in users, average load.

CPU: user, system, nice, idle, iowait, interrupt, etc.

Process: running, sleeping, stopped, zombie.

Memory: total, used, free, buffers, cache.

Swap: total, used, free.

Task area shows PID, user, priority, nice, virtual/physical/shared memory, state, CPU% and MEM%, cumulative CPU time, command line.

4. iostat

Monitors read/write counts, data volume, and utilization for each disk.

Install via the sysstat package:

yum -y install sysstat

5. sar

System Activity Reporter, a comprehensive Linux performance analysis tool that monitors network I/O per NIC.

Install after installing deltarpm:

yum install deltarpm</code>
<code>yum install sysstat

6. dstat

Shows overall system performance information (CPU, disk, network, paging) with colored, readable output.

Install:

yum install dstat-0.7.2-12.el7 -y

7. htop

Interactive process viewer with color themes, mouse support, and scrollable process list.

Install: yum install -y htop Advantages:

Starts faster than top.

Horizontal and vertical scrolling to view all processes and full command lines.

Kills processes without needing to type the PID.

Supports mouse operations.

LinuxSystem monitoringperfperformance toolshtopnmon
Huawei Cloud Developer Alliance
Written by

Huawei Cloud Developer Alliance

The Huawei Cloud Developer Alliance creates a tech sharing platform for developers and partners, gathering Huawei Cloud product knowledge, event updates, expert talks, and more. Together we continuously innovate to build the cloud foundation of an intelligent world.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.