Learn Steps

Monitor your unix system resources using HTOP.

When it comes to servers it is really important to keep track of memory, cpu utilization, which processes are taking what amount of CPU, what process are orphan processes etc. All these are required to take necessary step like kill a process if it is taking a lot of CPU or trigger autoscaling when CPU usage is above a threshold value. Thus let us see how to monitor your unix system resources using HTOP.

Monitor your unix system resources using HTOP.

Installation

sudo apt-get install htop

Usage

Just type htop in terminal and you will be able to see screen like the one below. 

As you can see from the top left 1 2 3 and 4 are the cores of the CPU and its showing how much they are utilized. 

Next it shows the memory usage by the system. You can also see total tasks, average load, battery and uptime of the systems.

Next in the list you can see all the process running with their process id CPU utilization memory time and resources. Thus you have info if any process if making your system unresponsive from these details.

So next what to kill that process right.

For that press F9 when you press F9 you will se screen like the one below.

Here on the left hand side you will get the list of signals you want the app to send after it is killed. Now press the number key corresponding to signal and the process will be killed.

Now lets say you want to search for the process, press F4 and type the substring and it will search the process for you like below. 

Look at the bottom there is text called filter after that is the text what we search for. Now that you get the process you can again press F9 if you want to kill the process. This is how htop is very useful.

Need more options for htop type the below command and you will see those.

man htop

 

This is the end of the article Monitor your unix system resources using HTOP. Liked the article please share and subscribe.

Also read about increasing performance of python code here.