Should I use forever/pm2 within a (Docker) container?

后端 未结 3 1007
囚心锁ツ
囚心锁ツ 2020-12-23 11:08

I am refactoring a couple of node.js services. All of them used to start with forever on virtual servers, if the process crashed they just relaunch.

Now

3条回答
  •  隐瞒了意图╮
    2020-12-23 11:45

    While it's a good idea to use --restart=always as a failsafe, container restarting is relatively slow (5+ seconds with the simple Hello World Node server described here), so you can minimize app downtime using something like forever.

    A downside of restarting the process within the container is that crash recovery can now happen two ways, which might have implications for your monitoring, etc.

提交回复
热议问题