我在 Windows 7 笔记本电脑上使用命令 php artisan queue:listen --sleep=10 --tries=3
运行队列监听器。我的电脑有 4 核 CPU,进程不断消耗 25% 的 CPU 负载。我尝试增加 sleep 参数,但它根本没有帮助。队列中没有作业。我正在使用数据库队列。如何解决,我的电脑很热。
最佳答案
将它作为守护进程运行,以阻止它启动越来越多的应用实例:
php artisan queue:work connection --daemon
来自 the docs :
The
queue:work
Artisan command includes a--daemon
option for forcing the queue worker to continue processing jobs without ever re-booting the framework. This results in a significant reduction of CPU usage when compared to thequeue:listen
command
关于laravel - 如何停止工匠队列 :listen command eating all CPU?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33554300/