What is Top Command and How to Read Top Command?
Top command is one of the basic command to monitor server processes in Linux. Top command shows all running processes in the server. It shows you the system information and the processes information just like up-time, average load, tasks running, no. of users logged in, no. of CPU processes, RAM utilisation and it lists all the processes running/utilised by the users in your server.
I am sure, this article will help you to check the basics about the processes running on your VPS or Dedicated servers.
Lets see how to read the Top Command and understand it well.
Top Command Output
The below command to be run once you login to server from terminal.
All you see will be just like the image I share you below
Let’s see every single row of the output to explain all the information found within the screen.
First Row : top
The very first line of the top command indicates in the order below.
current time (22 :14:26)
uptime of the machine (up 155 day, 16:33)
users sessions logged in (2 users)
- average load on the system (load average: 8.02, 8.67, 9.01) the 3 values refer to the last minute, five minutes and 15 minutes.
Second Row : task
The second row provides you the following information.
Total Processes running (866 total)
Running Processes (8 running)
Sleeping Processes (856 sleeping)
Stopped Processes (0 stopped)
- Processes waiting to be stopped from the parent process (2 zombie)
Zombie Process : A process that has completed execution, but still has an entry in the process table. This entry still need to allow the parent process to read its child exit status.
Third Row : cpu
The third row indicates how the cpu is used. If you sum up all the percentages the total will be 100% of the cpu. Let’s see what these values indicate in order.
All the CPU Processes will show in percentagess(%'s)
User processes of CPU in percentage(18.6%us)
System processes of CPU in percentage(16.8%sy)
Priority upgrade nice of CPU in percentage(0.2%ni)
Percentage of the CPU not used (64.1%id)
Processes waiting for I/O operations of CPU in percentage(0.3%wa)
Serving hardware interrupts of CPU in percentage(0.1% hi — Hardware IRQ
Percentage of the CPU serving software interrupts (0.0% si — Software Interrupts
The amount of CPU ‘stolen’ from this virtual machine by the hypervisor for other tasks (such as running another virtual machine) this will be 0 on desktop and server without Virtual machine. (0.0%st — Steal Time)
Fourth and Fifth Row : Memory usage
This rows will provide you the information about the RAM usage. It shows you total memory in use, free, buffers cached.
Sixth Row : Processes List
There is a last row to discuss CPU usage which were running currently. Let’s see what information we can observe in the different columns.
PID – ID of the process(819328)
USER – The user that is the owner of the process (root)
PR – priority of the process (20)
NI – The “NICE” value of the process (0)
VIRT – virtual memory used by the process (3423m)
RES – physical memory used from the process (3.3g)
SHR – shared memory of the process (1788)
S – indicates the status of the process: S=sleep R=running Z=zombie (S)
%CPU – This is the percentage of CPU used by this process (65.9)
%MEM – This is the percentage of RAM used by the process (5.2)
TIME+ –This is the total time of activity of this process (1363:48)
- COMMAND – And this is the name of the process (exim)
Now you will able to monitor in detail all the information that the top command displays, it helps you check excessive load, users who consumes more resources, or to know why the system is running slow, memory usage and many more.