Reputation: 531
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?
Upvotes: 19
Views: 19542
Reputation: 1107
To view full resources usage of individual PM2 process, use below command.
pm2 monit
which output like below. In my case this
electricity
so i have stopped this.
process was causing 100% cpu spike.
Upvotes: 0
Reputation: 1
for me. i just have to do pm2 logout i have 12 node server running by pm2. and it was sending data to web monitor.
Upvotes: 0
Reputation: 141
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.
Upvotes: 8