Understanding what your RHEL 8 server is doing in real time — and historically — is essential for diagnosing performance bottlenecks, identifying runaway processes, and planning capacity. RHEL 8 includes top by default and provides htop, vmstat, iostat, and sar as complementary tools that each excel in different scenarios. This guide walks through installing and using each tool to interpret CPU usage, memory consumption, I/O wait, and historical system statistics.
Prerequisites
- A running RHEL 8 server with root or sudo access
- EPEL 8 repository enabled (required for
htop) - Basic familiarity with the Linux command line
Step 1 — Install htop and sysstat
htop is not in the default RHEL 8 repositories — it is available from the EPEL 8 repository. Enable EPEL and then install both htop and sysstat (which provides iostat, sar, and mpstat):
# Enable EPEL 8
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# Install htop and sysstat
sudo dnf install -y htop sysstat
# Enable sysstat data collection service
sudo systemctl enable --now sysstat
The sysstat service runs a cron job that records system statistics every 10 minutes, building a historical record that sar can query later.
Step 2 — Interpret top Output
Launch top with:
top
The header section contains the most important summary metrics:
top - 14:22:01 up 5 days, 3:14, 2 users, load average: 0.12, 0.08, 0.05
Tasks: 142 total, 1 running, 141 sleeping, 0 stopped, 0 zombie
%Cpu(s): 1.2 us, 0.5 sy, 0.0 ni, 97.8 id, 0.3 wa, 0.0 hi, 0.2 si
MiB Mem : 3934.6 total, 421.3 free, 2108.5 used, 1404.8 buff/cache
MiB Swap: 2048.0 total, 2048.0 free, 0.0 used. 1574.3 avail Mem
- load average: 1, 5, and 15 minute averages. Values below the CPU core count indicate a healthy system.
- %Cpu wa: I/O wait percentage. Values consistently above 10–15% indicate a disk bottleneck.
- RES column per process: actual physical RAM used (not virtual). Sort by memory with
Mkey. - SHR column: shared memory (libraries). Subtract from RES for true private memory usage.
Useful interactive keys in top: P (sort by CPU), M (sort by memory), k (kill a process by PID), 1 (toggle per-CPU view), q (quit).
Step 3 — Use htop for Interactive Process Management
Launch htop:
htop
htop provides a color-coded, scrollable view of all processes with per-CPU bars and memory meters at the top. Key interactive shortcuts:
F2— setup (customize columns, color scheme, display options)F3— search for a process by nameF5— toggle tree view (shows parent-child process hierarchy)F6— change sort column (CPU%, MEM%, PID, etc.)F9— send a signal to the selected process (e.g., SIGTERM, SIGKILL)u— filter by userq— quit
htop is particularly useful for spotting CPU throttling on multi-core systems because each core’s utilization bar is displayed individually at the top of the screen.
Step 4 — Analyze CPU, I/O, and Memory with vmstat
vmstat reports virtual memory statistics, CPU scheduling, and I/O in a compact columnar format. Run it with an interval and count:
# Sample every 1 second, 5 times
vmstat 1 5
Example output:
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 0 421312 12840 1438080 0 0 1 8 88 210 1 0 98 0 0
0 0 0 421300 12840 1438080 0 0 0 0 102 230 0 0 100 0 0
Key columns:
- r: processes waiting for CPU (run queue). Consistently > number of CPUs indicates CPU saturation.
- b: processes in uninterruptible sleep (blocked on I/O).
- si / so: swap in / swap out (KB/s). Non-zero values indicate memory pressure.
- wa: CPU time spent waiting for I/O. Consistently high values suggest a disk bottleneck.
- us / sy: user-space and kernel CPU time percentages.
Step 5 — Check Disk I/O with iostat
iostat (from the sysstat package) reports per-device I/O statistics and CPU utilization. Use the extended flag -x for detailed per-device metrics:
# Extended I/O stats, 2 second interval, 3 samples
iostat -x 2 3
Important fields in the iostat -x output:
- %util: percentage of time the device was busy. Values near 100% indicate saturation.
- await: average time (ms) for I/O requests. Above 20–50 ms is typically a concern for spinning disks; SSDs should be under 1 ms.
- r/s, w/s: read and write operations per second.
- rkB/s, wkB/s: read and write throughput in KB/s.
Step 6 — Review Historical Statistics with sar
sar (System Activity Reporter) queries the historical data collected by the sysstat service. Review today’s CPU history:
# CPU utilization for today (sampled every 10 minutes)
sar -u
# Memory utilization for today
sar -r
# I/O statistics for today
sar -d
# Review a specific past date (format: MMDD, e.g., 0515 for May 15)
sar -u -f /var/log/sa/sa15
Historical data files are stored in /var/log/sa/ (one file per day). sar is invaluable for post-incident analysis — it lets you see exactly what the system was doing at the time of a reported performance problem, even if no one was watching.
Conclusion
You have installed htop and sysstat on RHEL 8, learned to interpret top output including load average and I/O wait, used htop for interactive process management, analyzed CPU and swap pressure with vmstat, measured disk I/O with iostat -x, and reviewed historical performance data with sar. Together these tools give you a complete picture of system health both in real time and historically.
Next steps: How to Create and Manage Swap Space on RHEL 8, How to Configure Automatic Security Updates on RHEL 8, and How to Set Up Log Rotation with logrotate on RHEL 8.