pm2 hangs and unable to restart process due to high numbers of request
Asked Answered
S

2

5

For the purpose of load testing i created an API which request around 2000 bookings at a time and after hitting this API, server(AWS EC2 instance) reaches to the more than 20% of CPU consumption and consume almost all the memory(900/991M) of system. After that i was trying to restart node app with pm2 restart but it's not working and even "pm2 ls" and "pm2 log" commands are also not working. What can i do now to run my application again ? List of command which i already run on server.

pm2 restart pid && pm2 log pid
pm2 ls
pm2 log pid
Synthiasyntonic answered 5/1, 2018 at 7:35 Comment(3)
Can you share the error message?Plasty
No error message was there it just got hanged over there. I disconnected server (via terminal) and after that when i again tried to connection via SSH it was refusing connection.Synthiasyntonic
Have you managed to solve this issue? I'm still experiencing it with version 5.2.2. It goes so far, that even ps -aux or ls command is not executing anymore and gives me the error: -bash: fork: retry: Resource temporarily unavailableAlsatia
P
9

Try to kill the current process of pm2:

ps -ef | grep pm2
kill -9 <PID_OF_PM2>

And then restart pm2 again.

Try to Upgrade to the latest pm2 version if the above not working after killing the pm2 process, using this command:

npm install pm2@latest -g
Plasty answered 12/1, 2018 at 9:53 Comment(0)
P
0

PM2 hangs when your project contains millions of files and it is watching all those files. Make sure to exclude the non-essential files from watch using ignore_watch.

Powwow answered 22/4, 2020 at 19:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.