Thursday, September 15, 2016

The world of NPM application life cycle management

How to demonize an NPM app , firstly why to demonize?
Well, an app process could have a life cycle and a support for its management, like init.d, upstart, etc..

NPM comes has its nice facility tool called "PM2"
https://github.com/Unitech/pm2

It is super cool , it restarts the app, every time it crashes, kill -9 <pid> what ever.
I ran into a situation , where i forgot that i orchestrated my NPM app with this PM2 tool, and could not find a reason why i have a port conflict.
I found that i have this app running, tracked the parent process, which is re-spinning this app, on my kill -9.

And have to do a "$ pm2 stopall"

No comments:

Post a Comment

bee-social