简体   繁体   English

在生产中运行 Laravel 队列

[英]Run Laravel queue on production


Could you please share your best solution for run Laravel queue on production server?您能否分享在生产服务器上运行Laravel 队列的最佳解决方案?

For now I see next solution:现在我看到下一个解决方案:

  1. First start queue:首次启动队列:
php artisan queue:work >> /var/log/queue.log &
  1. Add to crontab:添加到 crontab:
10 2 * * * php artisan queue:restart
11 2 * * * php artisan queue:work >> /var/log/queue.log &
  1. In case of project update on server:如果服务器上的项目更新:
php artisan down
php artisan queue:restart
#do update
php artisan queue:work >> /var/log/queue.log &
php artisan up

But I'm worrying about high load case.但我担心高负载情况。 What if some job will be stucked?如果某些工作会被卡住怎么办?
Maybe you have better solution?也许你有更好的解决方案?

You can set up the laravel supervisor to run the queues automatically instead of using the cronjobs您可以设置 Laravel 主管自动运行队列,而不是使用 cronjobs

Please find below the article for more details to run the queue automatically on the server without cronjob请在文章下方找到更多详细信息,以在没有 cronjob 的服务器上自动运行队列

Integration of Laravel Supervisor to process Queues 集成 Laravel Supervisor 以处理队列

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM