supervisord执行laravel队列

1、在etc/supervisord/中设置laravel队列信息
laravel-worker.conf内容如下:
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /www/wwwroot/域名/artisan queue:work --queue=default --sleep=1 --tries=3
autostart=true
autorestart=true
user=root
numprocs=20 #20个线程
redirect_stderr=true
stdout_logfile=/www/wwwroot/域名/logs/worker.log

laravel-other.conf内容如下:
[program:laravel-other]
process_name=%(program_name)s_%(process_num)02d
command=php /www/wwwroot/域名/artisan queue:work --queue=other–sleep=1 --tries=3
autostart=true
autorestart=true
user=root
numprocs=5
redirect_stderr=true
stdout_logfile=/www/wwwroot/域名/logs/other_worker.log

2、执行如下命令:
#解决方法使用下面命令启动
/usr/bin/python2 /usr/bin/supervisord -c /etc/supervisord.conf

sudo supervisorctl reread #重新读取配置

sudo supervisorctl update #配置文件修改后可以使用该命令加载新的配置

sudo supervisorctl start all #启动

sudo supervisorctl status #查看所有进程的状态

sudo supervisorctl shutdown #关闭supervisor

sudo supervisorctl reload #重启supervisor

你可能感兴趣的:(php,laravel,php)