Top command
Updated date: 2024-12-16
Top Command
Here is the top command output.
$ top
top - 08:55:11 up 228 days, 18:25, 34 users,  load average: 0.41, 0.31, 0.27
Tasks: 277 total,   1 running, 276 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.6 us,  1.1 sy,  0.1 ni, 98.0 id,  0.2 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  15645.8 total,   1113.4 free,  11368.9 used,   3163.4 buff/cache
MiB Swap:   4096.0 total,   2789.7 free,   1306.3 used.   3914.6 avail Mem 
    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                 
1292415 root      20   0 1452736 204960  21900 S   4.3   1.3  13473:38 kube-apiserver                                                          
1292486 root      20   0   10.7g  50424  11488 S   1.7   0.3   4845:29 etcd                                                                    
2034281 binoue    20   0 5877280   3.6g   3.6g S   1.7  23.4   9698:18 VBoxHeadless                                                            
1292371 root      20   0 1308844  69032  21448 S   1.3   0.4   4325:23 kube-controller                                                         
1292548 root      20   0 2558500  60588  24152 S   1.3   0.4   5265:51 kubelet                                                                 
2581921 binoue    20   0 1739128 326244 317116 S   1.3   2.0   3128:09 VBoxHeadless                                                            
1291770 root      20   0 2984192  32808   9480 S   1.0   0.2   4478:33 containerd                                                              
3610488 binoue    20   0   43.9g 522944  57276 S   0.7   3.3   0:09.47 node                                                                    
1292345 root      20   0 1287252  26724   8620 S   0.3   0.2 855:36.67 kube-scheduler                                                          
1292999 root      20   0 1238708   5196   2536 S   0.3   0.0  46:05.23 containerd-shim                                                         
1293730 65532     20   0  769604  22184   8460 S   0.3   0.1 393:43.99 coredns                                                                 
1545584 root      20   0 1013408  39892  16912 S   0.3   0.2 326:09.17 prometheus                                                              
1790839 root      20   0   82836   2424   2296 S   0.3   0.0  18:30.24 irqbalance                                                              
3288978 root      20   0 2213684  77600  56956 S   0.3   0.5 120:55.80 promtail                                                                
3610160 root      20   0       0      0      0 I   0.3   0.0   0:00.26 kworker/u16:1-events_power_efficient                                    
3610457 binoue    20   0   11.3g  99804  46372 S   0.3   0.6   0:03.57 node
Fields of the outputs
top - 08:55:11 up 228 days, 18:25- uptime
 
34 users:- 
of active users
 - you can see the details with the command, "w" or "who"
binoue@ubuntu ~ $ w 10:56:10 up 228 days, 20:26, 34 users, load average: 0.33, 0.25, 0.22 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT binoue tty1 - 21Apr24 9days 1.82s 0.01s -bash binoue pts/0 - 21Apr24 15days 0.60s 1.78s sudo su binoue pts/1 tmux(2174).%17 08May24 110days 0.02s 0.02s -bash binoue pts/2 tmux(2174).%23 15May24 71days 0.19s 0.19s -bash binoue pts/3 tmux(2174).%19 12May24 207days 0.03s 0.03s -bash binoue pts/5 tmux(2174).%18 08May24 110days 0.24s 0.24s -bash binoue pts/6 tmux(2174).%21 13May24 35days 6:01 0.41s /home/binoue/.vscode/cli/servers/Stable-f1a4fb101478ce6ec82fe9627c43efbf9e98c8 binoue pts/8 tmux(2174).%24 11Jun24 155days 0.03s 0.03s -bash binoue pts/7 tmux(2174).%22 14May24 128days 0.13s 0.13s -bash binoue pts/4 tmux(2174).%20 13May24 174days 27:45 17:34 /tmp/go-build1056321478/b001/exe/main binoue pts/10 tmux(2174).%27 04Jul24 154days 0.02s 0.02s -bash binoue pts/9 100.94.85.1 08:53 2:03m 0.01s 0.01s -bash binoue pts/11 tmux(2174).%28 04Jul24 155days 0.02s 0.02s -bash binoue pts/12 tmux(2174).%29 04Jul24 154days 0.02s 0.02s -bash binoue pts/13 tmux(2174).%31 18Aug24 109days 1:06 0.03s -bash binoue pts/14 tmux(2174).%30 09Jul24 150days 0.21s 0.21s -bash binoue pts/15 tmux(2174).%32 16Sep24 74days 0.03s 0.03s -bash binoue pts/16 tmux(2174).%33 24Sep24 71days 12:03 12:03 python3 -m http.server 8888 binoue pts/17 100.94.85.1 10:48 2.00s 0.04s 0.00s w binoue pts/19 tmux(2174).%39 05Nov24 11days 0.02s 0.02s -bash binoue pts/18 tmux(2174).%34 29Sep24 67days 0.06s 0.06s -bash 
- 
 load average: 0.41, 0.31, 0.27- The number is showing the CPU usage over the past 1 minute, 5 minute and 15 minute.
 
Tasks: 277 total, 1 running, 276 sleeping, 0 stopped, 0 zombie- the task is showing the current tasks. Running is just
 
%Cpu(s): 0.6 us, 1.1 sy, 0.1 ni, 98.0 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st- 0.6 us (user): This indicates that 0.6% of the CPU time is being spent on user processes, which are the applications or tasks initiated by users.
 - 1.1 sy (system): This indicates that 1.1% of the CPU time is being used by the kernel or system processes (internal system operations).
 - 0.1 ni (nice): This represents 0.1% of CPU time used by processes running at a "nice" priority level, which means they are scheduled to be lower priority.
 - 98.0 id (idle): A high percentage of 98.0% idle time means the CPU is mostly idle and has plenty of capacity to handle more work.
 - 0.2 wa (iowait): This shows that 0.2% of the CPU time is spent waiting for I/O operations (e.g., disk or network) to complete.
 - 0.0 hi (hardware interrupts): This means no CPU time is currently being used for handling hardware interrupts, such as those from a network card or disk controller.
 - 0.0 si (software interrupts): Similarly, no CPU time is being used for software interrupts, which are triggered by software events.
 - 0.0 st (steal time): No CPU time is being "stolen" by a hypervisor for other virtual machines. This is relevant in virtualized environments.
 
MiB Mem : 15645.8 total, 1113.4 free, 11368.9 used, 3163.4 buff/cache- Total Memory (15645.8 MiB): This is the total amount of physical RAM available on the system, which is approximately 15.6 GB.
 - Free Memory (1113.4 MiB): This is the amount of RAM that is currently unused and available for use by applications or processes, about 1.1 GB.
 - Used Memory (11368.9 MiB): This shows the amount of memory that is currently in use by processes, which is approximately 11.4 GB.This includes memory actively being used by applications and system processes.
 - Buffer/Cache Memory (3163.4 MiB): This is the amount of memory used for buffering and caching data. It is memory that the system is using to store data temporarily for quick access. While this memory is technically in use, it can be freed up when needed for other tasks.
 
MiB Swap: 4096.0 total, 2789.7 free, 1306.3 used. 3914.6 avail Mem- Total Swap (4096.0 MiB): This is the total amount of swap space available on your system, which is 4 GB. Swap space is a portion of the storage drive (typically an SSD or HDD) used as "virtual memory" when the physical RAM is full.
 - Free Swap (2789.7 MiB): This is the amount of swap space that is currently unused and available for the system to use if needed. In this case, around 2.8 GB of swap space is free.
 - Used Swap (1306.3 MiB): This is the amount of swap space that is currently in use, which is around 1.3 GB. This occurs when the physical RAM is full, and the system moves less frequently used data from RAM to swap to free up space in the RAM.
 - Memory Availability: Available Memory (3914.6 MiB): This is the amount of memory that is available for new processes or tasks. It includes both free physical RAM and some portion of memory used for caching that can be quickly reclaimed if needed. In this case, the system has about 3.9 GB of memory that can be allocated for new processes.