简体   繁体   中英

pm2 restarts nodejs process with no indications why

I installed NodeJS v8.1.2 on an Amazon Linux Distribution on aws.

I have pm2 installed that is in-charge of restarting process in cases it fails.

I catch uncaught exceptions in the process and log them so the process wont restart since I use socket.io and I don't want users to get disconnected on every single exception.

about two month ago after updating nodejs to v7, nodejs would restart randomly with no reason what so ever, so I decided to compile nodejs from sources using nvm, and it resolved the issue.

about a week ago I updated nodejs again to v8.1.2 and today the process restarted again with no reason at all, no exception... nothing on the servers stats where too high.. no reason what so ever.

what do I do?

any information regarding the issue would be greatly appreciated

updates

I checked /var/log/messages and I noticed a segmentation fault error at the time of the restart. do I have to create a core dump to investigate the issue further?

can a segmentation fault of the nodejs process can be caused because of my code ?

what do I do ? :)

I had this situation because of a memory leak. Try to monitor your RAM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM