Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 1.08 KB

supervisor.md

File metadata and controls

69 lines (51 loc) · 1.08 KB

安装

shell> apt-get install supervisor

操作

添加进程组

shell> cat /etc/supervisor/conf.d/program.conf 
[program:foo_worker]
command=/usr/bin/php /www/web/foo/worker.php
directory=%(here)s
process_name=%(program_name)s_%(process_num)s
numprocs=1
numprocs_start=0
startretries=20
redirect_stderr=true
stdout_logfile=AUTO
stdout_logfile_backups=0
stdout_logfile_maxbytes=1MB
autostart=true
autorestart=true
user=www-data

更新配置

shell> supervisorctl update

查看进程状态

shell> supervisorctl status

启动进程

shell> supervisorctl start foo_worker:foo_worker_0
shell> supervisorctl start foo_worker:*

停止进程

shell> supervisorctl stop foo_worker:foo_worker_0
shell> supervisorctl stop foo_worker:*

其他

修复 too many open files to spawn 的错误

shell> vim /etc/supervisor/supervisord.conf
[supervisord]
minfds = 65535

参考文献