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
3
  • Can you share the error message? Commented Jan 12, 2018 at 8:00
  • 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.
    – Jitendra
    Commented Jan 12, 2018 at 8:06
  • 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 unavailable Commented Jan 24, 2023 at 7:16

2 Answers 2

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
0
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.