I have an express server running with pm2(v2.4.2) and node(v7.7.4). Here is the pm2 list
screenshot:
Here is htop
screenshot:
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?
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.
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.
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”.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With