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

Valeri0's avatar

Different redis servers for cache and queue

Hi,

Horizon shows me the "Inactive state" trying to use two different redis servers for cache and queue.

In the config/database.php configuration file there are already various redis connections for each specific service:

        'default' => [
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_DB', 0),
        ],

        'cache' => [
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_CACHE_PORT', 6379),
            'database' => env('REDIS_CACHE_DB', 1),
        ],

default connection is used in config/queue.php:

'redis' => [
            'driver' => 'redis',
            'connection' => 'default', // this is the connection used by horizon and the queue system
            'queue' => env('REDIS_QUEUE', 'default'),
            'retry_after' => 120,
            'block_for' => null,
        ],

cache connection is used in config/cache.php:

'redis' => [
            'driver' => 'redis',
            'connection' => 'cache', // this is the connection for the cache service
        ],

In the database connections list I'm trying to change the params of the default connection to point a completely different server that I would like to use only for queue (separated from the redis server used for cache):

        'default' => [
            'host' => 10.157.0.7,
            'password' => null,
            'port' => 6379,
            'database' => env('REDIS_CACHE_DB', 1),
        ],

But horizon shows me the "Inactive" state.

Has anyone ever tried using two different redis installations?

I also trying to connect to the new redis instance by the horizon machine, and It works.

0 likes
0 replies

Please or to participate in this conversation.