Master Linux Server Monitoring with htop, Glances, and dstat
This guide introduces three essential Linux server monitoring tools—htop, Glances, and dstat—detailing their key interactive commands, configuration options, and the rich performance metrics they provide to help administrators quickly diagnose and resolve system issues.
Effective server management requires insight into CPU usage, memory consumption, disk I/O, network activity, and other vital metrics; three powerful Linux tools—htop, Glances, and dstat—serve as indispensable blades for this purpose.
1. The Seven-Star Sword: htop
htop offers a richer, more user‑friendly interface than the traditional top command, supporting interactive shortcuts for quick analysis.
u – filter processes by a specific user.
s – trace system calls of a selected process.
l – list open files of a selected process.
t – display the process hierarchy.
a – set CPU affinity for a process.
k – kill a selected process.
h – show help information for other commands.
The main htop display includes:
CPU usage bar with colors for low‑priority, normal, kernel, and virtual usage.
Memory bar showing used, buffered, and cached memory.
Swap bar indicating swap space consumption.
PID, USER, PRI, NI, VIRT, RES, SHR, S, CPU%, MEM%, TIME%, and Command columns providing detailed process information.
2. The Gentleman‑Lady Sword: Glances
Glances is a cross‑platform monitoring tool that can run in client/server mode, making remote monitoring straightforward.
Common Glances options include:
b – display network interfaces in bytes per second.
d – disable disk I/O module.
f – used with -o to set output file location/format.
o – specify output format (CSV or HTML).
m – disable the mount module.
n – disable the network module.
t – set refresh interval (default 3 seconds).
1 – show per‑CPU load statistics.
Server command: glances -s -B IPADDRESS
Client command: glances -c IPADDRESS
Glances presents comprehensive data on CPU cores, memory, swap, network, disk I/O, and mounted partitions, enabling rapid identification of performance bottlenecks.
3. The Peerless Sword: dstat
dstat combines the functionality of vmstat, iostat, netstat, and ifstat into a single, highly configurable tool.
Key dstat options:
c – CPU statistics.
d – disk statistics.
g – page statistics.
i – interrupt statistics.
l – load average.
m – memory statistics.
n – network statistics.
N – specify network interface.
p – process statistics.
r – I/O request rates.
s – swap statistics.
y – system statistics (interrupts, context switches, etc.).
top‑cpu – show processes consuming most CPU.
top‑bio – show processes with highest block I/O.
top‑time – show processes with longest CPU time.
top‑io – show processes with highest I/O usage.
top‑mem – show processes with highest memory usage.
ipc – inter‑process communication rates.
tcp – TCP socket statistics.
udp – UDP socket statistics.
raw – raw socket statistics.
unix – Unix socket statistics.
a – shortcut for -cdngy.
By mastering any of these tools, administrators gain deep visibility into Linux system behavior, enabling proactive troubleshooting and performance optimization.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
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.
