Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PM2 - CPU 100% usage

Tags:

pm2

I have an express server running with pm2(v2.4.2) and node(v7.7.4). Here is the pm2 list screenshot:

enter image description here

Here is htop screenshot:

enter image description here

As you can see, the CPU usage is 100%. And the running PIDs are not match with pm2 list. My server would get no response after a few hours or days. I can't find any log from pm2.log file. Sometimes pm2 restart fix this. But sometimes I can't execute any pm2 commands. I need to kill pm2 process by ps -Af | grep pm2 | awk '{print $2}' | xargs kill -9 and then restart.
So where are these two high cpu usage processes come from? That's why my server no response?

like image 246
Hom Avatar asked Mar 31 '17 07:03

Hom


People also ask

Why is my CPU usage at 100%?

If the CPU usage is around 100%, this means that your computer is trying to do more work than it has the capacity for. This is usually OK, but it means that programs may slow down a little. Computers tend to use close to 100% of the CPU when they are doing computationally-intensive things like running games.

Is it normal to have 90% CPU usage?

If you are currently not running any additional programs, your CPU usage should be anywhere between 1% and 10% just through Windows processes alone. Anything higher than that on an idle PC means that something might be wrong.

How do I turn off 100 CPU usage Windows 10?

100% CPU Usage in Games To do this, in Windows go to “Settings -> Privacy & security (Update & security in Windows 10) -> Windows Security -> Virus & threat protection -> Manage settings”. Here, switch the 'Real-time protection' slider to “Off”.

Why is my CPU usage at 70%?

It is normal for it to be high because the processor is not doing much at the moment. So, if your System Idle process is using 60% - 70% of your CPU, it means you're actually using 40% - 30% of it. Was this reply helpful? No the System Idle Process is only using 20-30% when running no or very few programs.


1 Answers

If it can help someone, I had the same problem and I have fixed this by fallowing this update procedure PM2 - Update and updated the startup setup script (copy/paste command). This problem seam to appear after upgrading Node, it may also help to npm update your servers running under PM2 after a Node version upgrade.

like image 185
WebSam101 Avatar answered Sep 20 '22 13:09

WebSam101