Question

How to find the process which is using 100% CPU?

Our server went down as cpu usage is 100% due to some process. We are not able to find that process even in logs. Some cron is running. How to identify it?


Submit an answer


This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
August 2, 2023
Accepted Answer

Hi there,

I recently answered a similar question here.

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

Let me know how it goes!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.