Demystifying the Linux TOP Command
Let’s review the information returned by the TOP command one by one. The values displayed by this command are updated every 3 seconds by default.
load average: 2.55, 1.08, 0.40
The load average represents the system load over the past minute, 5 minutes and 15 minutes, respectively. Load average reflects the average number of tasks that are either running on the CPU or waiting to be scheduled(including tasks waiting for CPU time). If the load average reaches or exceeds the number of CPU cores available on the server, it indicates that the system is fully utilized and tasks may start to queue, potentially causing performance degradation.
On a 4-core CPU, a load average of 4.0 means the CPU is fully utilized.
A load higher than the number of cores indicate CPU contention.
A load lower than the number of cores means the system has spare CPU capacity.
%Cpu(s): 3.3 us, 6.4 sy, 0.0 ni, 86.9 id, 1.4 wa, 0.0 hi, 1.9 si, 0.0 st
They represent how the CPU time was spent over the last sampling interval(3s). The CPU can only be in one state at a time, so all possible states together must equal 100%. If the total is slightly different from 100%, it’s due to rounding.
Get DevNotes’s stories in your inbox
Join Medium for free to get updates from this writer.
us (user) → CPU time spent in user space, where application programs are running
sy (system) → CPU time spent in kernel space, where operating system code is executed
ni (nice) → CPU time spent running user processes with a modified (lower or higher) scheduling priority
id(idle) → Percentage of time the CPU is idle. If id is close to 100%, the CPU is mostly unused, but if id is close to 0%, the CPU is fully utilized and continuously busy.
wa(I/O wait) → Percentage of time the CPU is waiting for I/O operations (such as disk or network I/O) to complete. A high value may indicate an I/O bottleneck.
hi (hardware interrupts) → CPU time spent handling hardware interrupts
si(software interrupts) → CPU time spent handling software interrupts
st → Percentage of time a virtual CPU is waiting for the physical CPU, typically seen in virtualized environments when the hypervisor is overcommitted.
MiB Mem: 3915.4 total, 2277.3 free, 1059.7 used, 829.3 buff/cache
Indicates the system’s physical RAM usage.
total → total installed RAM
free → completely unused memory
used → memory actively used by processes
buff/cache → memory used by the kernal for buffers and filesystem cache (this memory can be reclaimed if needed). High buff/cache usage is normal and healthy on Linux.
MiB Swap: 3915.0 total, 3915.0 free, 0.0 used, 2855.8 avail Mem
It shows swap memory usage, which is disk-backed memory used when RAM is under pressure. Swap space resides on disk and is significantly slower than RAM. If a large amount of swap is in use, it usually indicates memory pressure and can lead to performance degradation due to increased disk I/O and resource contention. The available memory (2855.8 avail Mem) represents the amount of RAM memory that can be allocated to new process without swapping. What matters most for system health is available memory, not free memory. Heavy swap usage is a warning sign for memory exhaustion.
Useful Linux commands:
cat /proc/cpuinfo → displays the number of cpus and their details
top -c
then shift + P → to order the results by CPU usage
then shift + M → to order the results by memory
vmstat 1 → displays virtual memory and system performance statistics(CPU, memory, swap and I/O), updating the data every 1 second
As a side note: systemd is the init system used by most modern Linux distributions. It has PID 1 and is responsible for starting services, restarting them if they crash, managing logs, controlling dependencies and startup order.



