How can I find out why my CPU Is spiking to 100%?

Posted January 28, 2014 42.7k views
I have one droplet that has 7 WordPress installs on it. Most sites get very little traffic so resources are not an issue. However, every so often the CPU spikes to 100% and stays there. The only thing I can do is log into the website and power cycle the machine. How can I find out what's causing this?
  • I have the same problem with a tiny apache2 in my droplet.

    I have just a simple apache2 and I am building a PHP webapp. I have seen this happend to me twice already while in VI in last 3 months. We should be atleast able to know why such things in droplets.

  • It’s reassuring I’m not the only one with this ongoing issue. I have a single WP install on a 512mb Ubuntu droplet. I get random 50–100% CPU spikes, sometimes twice a day, once in awhile never. This cripples logging in via ssh, or visiting its http address. No pattern found in the error and slow logs. Can’t tell if it’s DigitalOcean, ServerPilot, or a plugin.

    When debugging WP, there are no errors. I have WP Super Cache dump its cache every midnight, NOT when a post/page has been updated. There are no other scheduled processes performing like external backups—I haven’t been able to get that far.

  • I’m facing the same problem with a 512MB droplet. This is what I get:

  • i am facing the same problem twice. First I thought it was problem with my script but its working fine on another server. No way to detect why this is happening.

  • I too had this problem (with smallest droplet 0.5 GB RAM + ISPConfig 3), So I tried digging into the problem, I used “htop” to monitor the process that was eating the CPU out, I saw “amavisd ” was the only culprit.

    So I searched the interwebs and found similar problem being reported so I disabled the “amavisd” By this command “systemctl enable amavisd.service” and commenting out the “Example” line inside the fiel “/etc/freshclam.conf”.

  • Show 1 more comments

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.

39 answers

I believe that all of those reports of “out of memory” are related to lack of virtual memory. Digital Ocean droplets don’t come with swap partitions enabled by default, so the kernel just kill the process when it’s not possible to allocate more RAM for it

I had problems with a long-running Java process I developed and the solution was pretty simple.

Check the links below to enable it on Ubuntu or CentOS:

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.
Are you able to SSH into your droplet when the CPU spikes to 100%? If so, run top after you connect—the processes will be listed by CPU usage.
When I try to SSH in, it just sits there and waits for an opening to connect. Which doesn't seem to ever happen.
Hmm. Can you access your droplet via the remote console (
I never tried that one. Basically since the server is overloaded, connecting to it any way probably isn't going to happen.
The console is already running on your droplet, it's like hooking up a monitor and a keyboard to your server and making them available to you through the browser. Give it a shot, there's a high chance you'll be able to log in.
Thanks. I'll try that next time as long as it's not 4am. :)

Hopefully it'll be a while before this happens again, but then again, it could be a day or two.
Sadly, that didn't take long. It was just down. Looks like it's out of memory.

I wasn't able to do anything but see the message above.

Now I need to figure out what's taking up so much memory as my sites aren't that popular that they should be eating up so much memory.
The only solution I can find is to abandon the droplet. There is something seriously wrong and no clue how to find out what. The droplet currently has 5 sites running on it, one is static HTML and the rest are WordPress. Combined they maybe get 100 hits a day.

When the server spikes the CPU graph goes through the roof and I can't terminal in, I can't use the virtual console, I can't do anything but force it to shutdown or reboot.

When I am able to get into the virtual console, all it says is "out of memory" and it's trying to kill processes. But it never lets me log in or do anything.

All I can come up with is it's out of memory. Even though the sites get very little traffic, 512 seems to be to little. Even if this is the case, it's strange how it can go one week and be fine. Then crash three times in the next week.

I did find this in the messages log: mysqld invoked oom-killer. That seems to be when the server stops responding. Googling that I came up with these:

Long story short, I have no idea what's going on still.
I have the same issue, this seems to be an issue on DO's side.
Hey! I have the same issue on some droplets running a nodejs app. Any chance that it could be a DO issue?

I have a similar situation, running Virtualmin + Wordpress on a 512mb Ubuntu 14 droplet. Suddenly the site became unresponsive while testing out a new e-mail notification system, turns out CPU was through the roof on the real-time chart.

Does anyone have any clue as to which logs to look at for more info?


Same sh… thing happens here. It spikes out of blue, CPU 100%, no outside access, no ssh, the only thing I can do restart the droplet which is the same as pressing power button.
Since when I need to press a power button on the server?
Something seriously freaked up on DO side

The samething happend, 512MB-20GB-1T-NY-CENTOS-NODE.
The CPU suddenly spiked and I was not able to login. I had to reboot the server.

Hi all, I have just had this happen to one of my droplets (CentOS7). Suddenly my SSH was terminated and I couldn’t log back in.

Had to do a graceful/forced reboot to re-gain access..

The server is only there to hold backup files so im slightly worried that the droplet is not reliable. :-/

Same issue here. Running nodejs + mongodb on ubuntu.

Same issue here, are DO acknowledging this problem> We find we are restarting the server ever 5-6 days. CPU at 100%

I have the same problem, i found out the reason, that the Whois command consumes the most CPU 99.9%.
but why is this command and how to solve it?

I am facing the same issue. I am running the Django framework on droplet with 2 GB Memory / 40 GB Disk / SGP1 - Ubuntu 14.04.3 x64. API’s are implemented and using ORM Mysql query to send the response. Even when 10 user uses the App, CPU load goes more then 100% and I can’t access the droplet until I reset the password from digital ocean online account.

The same for me.
Tiny Node.js app on 512mb Ubuntu 14.04.4 LTS droplet.
I’ve just bought this machine a week ago and it happened three times so far.
Look at the screenshot it happens regularly:

Same issue ,CPU keeps maxing out!!

I have one apache server with 5 WP sites, this was running fine but I had an ubuntu server with 1 site that kept crashing out. Having researched I came to the conclusion it was ubuntu, so I moved the site onto the Apache one which had been fine for 2 weeks.

Now.. All of a sudden its doing it again even when I disable sites to try diagnose which one’s causing the problem the CPU just keeps maxing, longest I can keep it going is a few min before having to power cycle.

Will have to abandon DO at this rate

Hey people, I got the solution for Node.js based apps!

All you need to do is to say Node app how much memory it should take.
node --max_old_space_size=256 app.js
since then, it works fine for 512MB Droplet :)

Anyone find a solution to this with a WP install. I have a WP site with no traffic or DNS even pointing to the site, doesnt matter if I use WP default 2016 theme or an optimized custom theme, after a day or two it just spikes to 100% and I have to reboot it. I installed via server pilot and have about 10 other accounts that work fine, this one I have recreated the droplet 3 times and still see this issue, its like its only on this account?

My droplet (512MB, 20GB) experienced the same issue. I manage to find the process ‘update-apt-xapi’ was causing the high usage. The solution in my case was to alter the priority of the cron config. Solution #1 on this site Ubuntu : update-apt-xapi takes lot of cpu usage.

Hope that helps someone

Even though the thread is already pretty old, I got the same problem. So far I have nothing special running on my machine and I already resized it to the second lowest droplet but the cpu load for “user” is up to 100% as you can see on the picture.

Anyone any idea why this is happening?

Even htop shows that there is nothing significant going on but the cpu is still on 100%.

I was literally scared, well, you can’t fix this. The only way you can go is to upgrade your droplet. I was using the $5 droplet and I had to switch to $20 droplet and now it’s all okay again. I was legitimately scared, mate.

My site is now running fine! I’m glad!

Ok guys, I had the same cpu issue I solved but I am not sure if my situation is the same as yours.

I had a WordPress site with a weak password that site has been infected with a trojan horse. I cleaned it up but after that my cpu is almost 100% but I could still log in my ssh, I used top command line as @kamaln7 said I found a process that take more than 98% of the cpu usage it was with strange name like phpCDKJVG_vclmz I killed it using kill -KILL (PID). and everything back to normal again.

I hope that may help any of you.

  • Glad you were able to identify the issue! Since your Droplet is infected, killing the process might not be enough—it could come back. I would recommend spinning up a new Droplet and migrating your old Droplet’s contents manually to it, making sure to set up Wordpress and any plug-ins from scratch and not copy them over from the old Droplet to prevent being infected again. Of course, make sure you set a strong password and only install plug-ins that you trust :)

I have the same problem. My config is 2GB ram 2 cores 30Gb space. 600%over cpu in the graph. But Digital Ocean don’t have answers. They say It’s a config problem, but 4 reboots in one week is a lot. My clients are very angry.
I fix a little my apache conf and mysql conf but.. that not the problem.

I have the same problem. My droplet is ubantu16.04 , 2 GB Memory / 50 GB Disk / SGP1 and setup glassfish4.1 , j2sdk 8. On Start glassfish the cpu load is normal. After long run cpu spin to 99-100% and the process used cpu 100% is java that is jvm to run the glassfish.

Seems like a lot of people are coming across this issue, I myself am facing it. I upgraded from $5 to $20 and still have the same issue but the server 99% of the time runs at like 2-3% see image here:

I am hosting one small wordpress website on plesk.

Any help I would be grateful.

Same here, I use Standard / 4 GB / 2 vCPUs and still 100%. I found that the MySQL server is using most of it. With TOP command, it said that CPU Usage 200%, I have try so many different configurations, and still get above 100%.

Has that happened because it shared CPU ?? Standard droplet use shared CPU.

A four year old post, 30k views and no input from DO, if these issues don’t get resolved im moving everything to vultr.

Why the support is not replaying to this issues?
I had a site hosted on DO for 4 years now, never had any significant problems.
A now this happens CPU spiked at 100% and I can’t do anything. The support is not answering tickets.


we are getting same issue ,we are using $40 server with only 1 site..30-40 real time only and using memcache and CDN still we are getting this issue since last 3 -4 days ..generated ticket but no reply.waiting for solution else will needs to think to move on other’s.

It’s December 2019. Please DO say something. Open your mouth. A newborn baby can say everything after 5 years but DO guys till now zipped?

I was facing similar issue of 100% CPU use. It was happening on a server where only Redis is installed apart form the Ubuntu OS. The issue started when i open the redis for all ports. which is updating the bind to I had to do so because specific ip binding was not working. I was searching the solution for last few days. While the process goes high one process named kdevtmpfsi was using the full computation power.

then i updated the redis via ppa and edited the config once again,

nano /etc/redis/redis.conf

bind localhost

Here is the private IP of the redis server.

You can follow the guide to install the Redis from here:

by Erika Heidi
Redis is an open source key-value cache and storage system, also referred to as a data structure server for its advanced support for several data types, such as hashes, lists, sets, and bitmaps, amongst others. It also supports clustering, which makes it often used for highly-available and scalable environments. In this tutorial, we'll see how to install and configure an external Redis server to be used as a session handler for a PHP application running on Ubuntu 14.04.

I install Ubuntu WordPress on 18.04 on droplet and My droplet CPU is showing to 96% used and my website is breaking and I have low web traffic so what I do next?

I am having the same issue. For no apparent reason CPU Usage, Disk I/O have spikes and I am only running one simple Drupal site.

I have also the same issue. CPU cross 100% even if I open my site pages in mobile for viewing. mean I am only the user at that time on my site. still it. I have two magento 2 sites with 50 GB Space, 2 GB RAM and 2 GB Bandwidth. what should I do. each site hs only 70 to 150 products only

Submit an Answer