It seems to be suitable for super worship . The following configuration ensures that 10 processes always work, and deals with log rotation, which is also convenient. All products, including stderr, will be recorded in /var/log/worker.log. When "autorestart = true", supervisord will replace the child process as soon as it exits.
[program:worker] command=php /path/to/worker.php process_name=%(program_name)s_%(process_num)d stdout_logfile=/var/log/%(program_name)s.log redirect_stderr=true stdout_capture_maxbytes=512MB stdout_logfile_backups=3 numprocs=10 numprocs_start=0 autostart=true autorestart=true
Once you have a supervisor configuration (usually / etc / supervisord / conf.d), you can use supervisorctl as a convenient way to start and stop a group of processes.
$ supervisorctl start worker ... $ supervisorctl stop worker ... $ supervisorctl status worker:worker_0 RUNNING pid 8985, uptime 0:09:24 worker:worker_1 RUNNING pid 10157, uptime 0:08:52 ... worker:worker_9 RUNNING pid 12459, uptime 0:08:31
source share