【发布时间】:2020-06-29 10:44:24
【问题描述】:
我在一个数字海洋水滴上有两个站点,生产和登台。我已经根据文档安装了队列管理器:sudo apt-get install supervisor,并在/etc/supervisor/conf.d 中配置了两个配置文件,如下所示:
laravel-worker.conf:
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/app.com/artisan queue:work database --sleep=3 --tries=3
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/app.com/worker.log
stopwaitsecs=3600
laravel-worker-staging.conf:
[program:laravel-worker-staging]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/test.app.com/artisan queue:work database --sleep=3 --tries=3
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/test.app.com/worker.log
stopwaitsecs=3600
完成测试后,我将禁用 test.app.com 的服务器块,以防止随机用户访问该站点。我是否需要对队列管理器执行任何操作,因为它仍将在测试站点的后台运行,或者可能是 laravel-worker-staging.conf 以防止它不必要地耗尽服务器资源?
【问题讨论】: