A slow Linux system may be short of CPU time, or it may be waiting on something else. The top monitor shows CPU usage alongside running processes, helping distinguish a busy application from a machine with spare processor capacity.

The procps version of top combines a system summary with a process table. The summary averages activity across logical CPUs, while the process table normally measures each task against one logical CPU. A single busy thread can therefore approach 100% CPU while the machine still has idle capacity, and a multithreaded process can exceed 100% CPU.

A brief spike does not establish sustained CPU pressure; several refreshes show whether the activity persists. Inside a container, the CPU summary and load averages may describe the host rather than the container's CPU allowance, while the task table only lists processes visible inside that container.

Steps to show CPU usage in Linux with top:

  1. Start top in the terminal.
    $ top

    No root privileges are required. The CPU summary appears below the load average and task counts.

  2. Read the %Cpu(s) line after the next screen refresh.

    us is time running ordinary user processes, sy is kernel time, and ni is time running processes with an adjusted nice value. A high id value means idle capacity; sustained low id with high us or sy indicates CPU activity. wa is I/O wait, rather than active CPU work. hi and si are hardware and software interrupt time, and st is virtual CPU time taken by the hypervisor.

  3. Press uppercase P to sort processes by CPU usage.

    The %CPU column shows activity since the previous refresh; PID and COMMAND identify the process. Here, yes uses 99.0% CPU while the combined summary remains 87.5% idle. Its high usage occupies roughly one logical CPU, rather than the whole machine. The TIME+ column is accumulated CPU time, not a current percentage.

  4. Press 1 to display usage for each logical CPU.

    The combined line becomes %Cpu0, %Cpu1, and further CPU rows. Here, Cpu1 has only 1.0% idle while most other CPUs are idle. A busy thread can move between CPUs, so the busiest row may change between refreshes. Pressing 1 again restores the combined summary.

  5. Press q to return to the shell.
  6. Capture two CPU readings one second apart for a copyable snapshot.
    $ top -b -d 1 -n 2 -o %CPU
    ##### snipped #####
    top - 01:10:07 up 10 days, 21:44,  0 user,  load average: 0.66, 0.25, 0.24
    Tasks:   4 total,   2 running,   2 sleeping,   0 stopped,   0 zombie
    %Cpu(s):  3.4 us,  9.4 sy,  0.0 ni, 86.9 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st 
    MiB Mem :  11946.3 total,   2621.1 free,   1116.7 used,   8470.2 buff/cache     
    MiB Swap:   4096.0 total,   4016.6 free,     79.4 used.  10829.6 avail Mem 
    
        PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
       1629 user      20   0    2708   1552   1452 R  98.0   0.0   0:57.14 yes
          1 root      20   0    2708   1620   1528 S   0.0   0.0   0:00.01 sleep
       1621 root      20   0   32800  20980   7528 S   0.0   0.2   0:00.08 Xvfb
       1756 user      20   0    9032   5024   3016 R   0.0   0.0   0:00.00 top

    -b produces plain text, -d 1 sets the interval, -n 2 stops after two displays, and -o %CPU sorts by CPU usage. The first display is omitted here; the second measures the intervening second. It shows yes at 98.0% CPU with 86.9% idle overall, confirming a busy process alongside spare system capacity. On a CPU-bound machine, low idle time persists across readings. Actual values and process names vary.

Share this guide