The modern and stable CLI process manager for Node apps with native clusterization, monitoring, startup scripts and much more.
# Multi process JSON declaration
processes.json :
[{
"name" : "echo",
"script" : "./examples/args.js",
"instances" : "1",
"args" : "['--toto=heya coco', '-d', '1']",
"cron_restart" : "* * * * * *"
},{
"name" : "api",
"script" : "./examples/child.js",
"instances" : "4",
"fileError" : "./examples/child-err.log",
"fileOutput" : "./examples/child-out.log"
},{
"min_uptime" : "100",
"max_restarts" : "400",
"name" : "auto-kill",
"script" : "./examples/killfast.js"
}]
Then with the cli :
$ pm2 start processes.json
Special options with JSON process declaration
-
"min_uptime":
if a process is restarted with an uptime smaller than this value,
this restart counts as an unstable restart. If this option is not specified,
all restarts are considered unstable.
-
"max_restarts":
if the number of unstable restarts exceeds this number,
the process will be stopped and a message with number with restarts will be logged.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.