You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have configured the Symfony bundle to use Redis via php-redis. The queue producer and consumer are working, however when I run the console command php app/console enqueue:consume --setup-broker it seems to poll Redis every few milliseconds causing the PHP script to have about 50% CPU usage and Redis about 20%.
Is there an option to set a timeout to reduce the polling rate and reduce resource usage?
The other solution: Add the third argument to queue consumer which is idle time. It could be a DI parameter with a default value set in the enqueue bundle, but there is a way to overwrite it from the app.
Activity
makasim commentedon Sep 5, 2017
There is no such option yet. Here's a solution we made for dbal transport. It might work for redis too.
https://github.com/php-enqueue/enqueue-dev/blob/master/pkg/dbal/DbalConsumer.php#L96
makasim commentedon Sep 5, 2017
The other solution: Add the third argument to queue consumer which is idle time. It could be a DI parameter with a default value set in the enqueue bundle, but there is a way to overwrite it from the app.
https://github.com/php-enqueue/enqueue-dev/blob/master/pkg/enqueue-bundle/Resources/config/client.yml#L82
makasim commentedon Sep 11, 2017
There is
--receive-timeoutoption is available since 0.7.11. You can use it to increase time a consumer waits on a socket for a message.