I have a test/staging setup where I am running 5 node processes with PM2 on a t2.small machine (1 core and 1.7 GB RAM). Of late I am seeing that one of the processes (which receives the maximum traffic) hangs. Since the process does not exit or throw an exception PM2 assumes it to be alive. As a result my health checks fail (request is hung and never returns) and the API is DOWN.
I am using nodejs with express framework. I am not making any remote network calls from my code which could be blocking it. Restart fixes the issue always.
I can think of a few hacks to restart the process but I want to find answers to a few questions:
The issue was with one of the iOS push notification libraries. It was not getting initialized properly (missing attribute). Whenever i tried tried to call that lib in the code the whole JS VM would just freeze.
Dont know the reason why it froze but fixing the library initialization solved the issue.
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.