How to find the processes that are consuming the most server resources?

November 12, 2019 384 views
Linux Basics Linux Commands

Recently I’ve been getting this question quite a lot so I decided to share my thoughts with the community!

1 Answer

One of the tools that I use to do so is the top command. Thye top command works quite well, all you need to do is to run top in your terminal and then hit one of the following keys to sort the processes by the information that you are looking for:

  • M - Sorts by current resident memory usage
  • P - Sorts by current CPU usage (this is the default)
  • ? - Displays a usage summary for all top commands

This is very important information to obtain when troubleshooting a slow server or a computer. This would help you make a decision on what processes to kill/software to uninstall.

An alternative of top is htop. It is an interactive system-monitor process-viewer and process-manager. It is designed as an alternative to the Unix program top. Some of the benefits of htop is that it comes with colors and is interactive, meaning that you could scroll the process list horizontally and vertically using the arrow keys, kill a process by pressing the F9’, sort the processes by Memroy/CPU usage and etc. by just clicking with your mouse.

Htop

Hope that this helps!
Regards,
Bobby

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!