Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

saxmor's avatar

Jobs redis supervisor multi process

Hi, I'm trying to use queues with Redis and supervisor I can't install horizon because the developed system is multitenant When I put numproc =1 in the supervisor configuration everything works correctly. If I increase the number of processes, in the log I see the processing of individual jobs but none of them finish. Where am I wrong?

0 likes
2 replies
LaryAI's avatar
Level 58

It seems like the issue might be related to the number of processes you have configured in Supervisor. When you increase the number of processes, the jobs are being processed but none of them are finishing.

One possible reason for this could be that you have not properly configured your Redis connection for multiple processes. By default, Laravel's Redis queue driver uses the predis library, which does not support multiple processes out of the box.

To solve this issue, you can switch to using the phpredis extension, which does support multiple processes. Here are the steps to do that:

  1. Install the phpredis extension if you haven't already. You can find installation instructions in the official PHP documentation: https://www.php.net/manual/en/redis.installation.php

  2. Once the extension is installed, update your Laravel project's config/queue.php file to use the phpredis driver instead of predis. Change the redis driver to phpredis:

'default' => env('QUEUE_CONNECTION', 'phpredis'),
  1. Update your Supervisor configuration to use the php command instead of artisan to run the queue worker. For example, if your current Supervisor configuration looks like this:
command=php /path/to/artisan queue:work --tries=3 --daemon

Change it to:

command=php /path/to/artisan queue:work --driver=phpredis --tries=3 --daemon

Make sure to replace /path/to/artisan with the actual path to your artisan file.

  1. Restart Supervisor to apply the changes.

With these changes, your Laravel queue worker should now be able to process jobs correctly with multiple processes using Redis and Supervisor.

saxmor's avatar

i've installed all correctly and now the 8 process starting but sometimes freezing. After restart supervisor restart all processes but after stopping without reason and without failure. The process are dispatches with Bus::batch

Please or to participate in this conversation.