【发布时间】:2019-04-30 13:16:55
【问题描述】:
您能否分享您在生产服务器上运行 Laravel queue 的最佳解决方案?
现在我看到了下一个解决方案:
- 第一个启动队列:
php artisan queue:work >> /var/log/queue.log &
- 添加到 crontab:
10 2 * * * php artisan queue:restart
11 2 * * * php artisan queue:work >> /var/log/queue.log &
- 如果服务器上的项目更新:
php artisan down
php artisan queue:restart
#do update
php artisan queue:work >> /var/log/queue.log &
php artisan up
但我担心高负载情况。如果某些工作会卡住怎么办?
也许你有更好的解决方案?
【问题讨论】:
-
您能否澄清以下内容:您是否在 docker 上运行?还是在独立服务器上?
标签: php laravel-5 queue devops production