Pm2 runs at 100% CPU - how to debug

For the last couple of weeks I have been struggling with pm2 100% cpu usage which hangs on my node server.

I tried reading the logs but I didn't find any problems there.

My node version: 6.9.1
PM2: 2.4.4.
OS: Ubuntu 14.04
Average cpu usage: ~ 5

In manual mode I restart all applications - pm2 reloads everything.

pm2.log: fluid_admin@instance-2:~$ tail -15 .pm2/pm2.log

2017-04-12 09:55:30: Starting execution sequence in -fork mode- for app name: fluid-prod id: 0
2017-04-12 09:55:30: App name: fluid-prod id: 0 online
2017-04-14 13:53:21: Stopping app: fluid-prod id: 0
2017-04-14 13:53:21: Stopping app: nedbserver id: 1
2017-04-14 13:53:21: App [nedbserver] with id [1] and pid [32557], exited with code [0] via signal [SIGINT]
2017-04-14 13:53:21: pid = 32574 msg = failed to kill - retrying in 100ms
2017-04-14 13:53:21: pid = 32557 msg = process killed
2017-04-14 13:53:21: Starting execution sequence in -fork mode- for app name: nedbserver id: 1
2017-04-14 13:53:21: App [fluid-prod] with id [0] and pid [32574], exited with code [0] via signal [SIGINT]
2017-04-14 13:53:21: App name: nedbserver id: 1 online
2017-04-14 13:53:21: pid = 32574 msg = process killed
2017-04-14 13:53:21: Starting execution sequence in -fork mode- for app name: fluid-prod id: 0
2017-04-14 13:53:21: App name: fluid-prod id: 0 online

The application runs on GAE, OS: Ubuntu 14.04.

My cpu usage when PM2 is high

I moved from permanently to pm2 6 months ago. until recently it was a working file, but now I face this problem frequently.

I don't know how to deal with this problem. Can anyone help me debug this issue.

It happened again. TOP Command Output PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
25059 fluid_a+ 20 0 1260364 105532 8236 R 99.7 17.5 58:27.27 node fluid/server/tools/www + 1 root 20 0 33520 3208 1792 S 0.0 0.5 0:04.82 /sbin/init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 [kthreadd]


Script to run my application:

pm2 stop fluid-prod pm2 start \ -n fluid-prod \ -e /path/to/fluid-error.log \ -o /path/to/fluid-out.log \ $(dirname $0)/www -- --max-memory-restart 200M --env=production

+3


source to share





All Articles