how to automatically restart a node server?

前端 未结 3 1396
后悔当初
后悔当初 2021-02-06 22:23

We are finishing development of a project, the client is already using it but occasionally some errors occur - crashing the server.

I know I could register a service as

3条回答
  •  独厮守ぢ
    2021-02-06 23:02

    If your focus for automatic restart is an always running application, I suggest to use a process manager. Process manager, in general, handles the node process(es if cluster enabled), and is responsible for the process/es execution. PM leans on the operative system: your node app and the OS are not so strinctly chained because the pm is in the middle.

    Final trick: put the process manager on upstart.

    Here is a complete performance improvement path to follow.

提交回复
热议问题