We earn commission when you buy through affiliate links.
This does not influence our reviews or recommendations.Learn more.
Know how much an individual process or system-wide consume CPU or memory.
There are manymonitoring softwarewhich does this out of the box.
But if you dont have one or looking for a command-based solution, then here you go.
They are all FREE!
top
You may want to start by looking intotoporhtopresult to see the processes overview.
Thetopis installed on almost all Linux distribution.
you’re free to still usetopcommand but with some argument.
Lets say you know the process id (PID); you could use the below command.
top -p $PID
Below an example oftop -p 3102
You may also usegrepwithtop.
Below an example of checkingDockerutilization.
htop
Similar to the top but with more information.
And also it is colorful.
htop may not be installed by default, but you might always do it as below.
glances
As the name says, you get a system utilization view on a single screen.
Running processes are sorted by their CPU utilization.
you’re free to install glances on CentOS 8 using DNF as below.
Imagine there is a pattern of having an issue at a specific time window.
you could schedule to write the output in a file throughcrontabor other, and later you could playback.
and I would strongly recommend taking a look at the man page.
If you are just interested in real-time troubleshooting, then just executeatopand you should see like below.
you could install atop as below.
ps
Lets checkpscommand now.
you might use the ps command with PID to print their CPU and memory utilization.
The output should look like this.
To view the top process (by utilization), you’re able to executenmonand presstbutton.
you could install nmon as below.
Monit also got a cool widget.
Its light-weight monitoring software.
But, there is more toexplore here.
It will be a good choice when you are managing cloud-based servers and looking for a proactive monitoring solution.
It is open-source and getting started is easy.
All the data is collected, stored, and streamed for you to visualize interactively.
Data is collected every second, so you never miss anything.
Loved by many industry leaders.
So what you are waiting for, try and take control of your Linux servers.
btop also comes powered with an auto-scaling graph showing connection usage.
Besides, you could also check disk speed and complete I/O activity.
There is more to this that you might experience on Linux, FreeBSD, and macOS.