Linux installations come with a bevy of tools that are acceptable for this purpose, but none are quite as universal as top. Or, for those who like a little more interactivity, htop.
By default, top displays the most CPU intensive processes currently running on your VPS. It will update the list every 3 seconds so that you can understand if a process is spiking CPU usage every so often or is a consistent hog.
You can use a number of different options while running top to customize its output.
Specify the refresh period, in seconds. The below command will change the period to 10 seconds.
top -d 10
Sort by specific column. First, type top -O to see which columns are available to you, then use top -o to specify. For example, you can search by TIME to see which processes have been running longest.
top -o TIME
Or based on CPU usage.
top -oby subscribing to our newsletter.