Redis queue & Horizon

Posted 1 year ago by troovers

Hi guys,

I've upgraded to Laravel 5.5 this week and installed Horizon to monitor my queues. For that to work, I had to change the queue driver from database to Redis. I didn't expect much trouble caused by that switch. I was wrong, unfortunately.

I've managed to get Horizon up and running (easily) and configured the Redis queue driver. In my local environment, everything is working fine! Then I went live and I noticed that around 50% of my jobs aren't being executed. When I check the Horizon dashboard, about 50% of the jobs has a red cross behind them, but didn't fail. So, they didn't even fire. This doesn't happen to a specific job, it just happens randomly. For instance: sometimes a job succeeds five times in a row, and then isn't executed for three times. Pretty annoying as you can guess. But, because I got no errors whatsoever, debugging is a pain in the ass. Maybe you can help me with the problem. Below you'll find my configs.

config/queue.php

'connections' => [

        'redis' => [
            'driver' => 'redis',
            'connection' => 'default',
            'queue' => 'default',
            'retry_after' => 60,
        ],

    ],

config/horizon.php

'environments' => [
        'production' => [
            'supervisor-1' => [
                'connection' => 'redis',
                'queue' => ['default'],
                'balance' => 'auto',
                'processes' => 10,
                'tries' => 3,
            ] 
        ],

        'dev' => [
            'supervisor-1' => [
                'connection' => 'redis',
                'queue' => ['default'],
                'balance' => 'simple',
                'processes' => 3,
                'tries' => 3,
            ],
        ],
    ],

Thanks in advance!

Thomas

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.