Ubuntu – How to find the process with the highest load

command linecpu load

I have a single core VPS with a load average that goes beyond 25 at times. When it reaches that, it becomes unbearably slow, and even commands run through dash, which is faster and uses less RAM than bash, takes a while to run. How can I track down what process is causing the high load?

Best Answer

You can install htop. Good thing about htop is that it will show you your usage per CPU, as well as a meaningful text graph of your memory and swap usage right at the top.

To install htop:

sudo apt-get install htop

Start it:

htop

enter image description here

Press F6 to sort the processes, then using the navigation key you can choose PERCENT_CPU and press enter.

enter image description here

Or you can use top in this way (source):

top -b -n 1 | head -n 12
Related Question