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

jorgenb's avatar
Level 16

Scale Laravel and Horizon (horizontally)

I need to scale up a Laravel app that uses Horizon and stick it behind a load balancer. Can I simply continue to run Horizon on each app node without fear of having the same job processed multiple times?

I am using the default Horizon config that comes with L6:

    'environments' => [
        'production' => [
            'supervisor-1' => [
                'connection' => 'redis',
                'queue' => ['default'],
                'balance' => 'simple',
                'processes' => 5,
                'tries' => 3,
            ],
        ],
]
0 likes
5 replies
corbosman's avatar
Level 20

I believe this will work fine as long as they all use the same redis server.

1 like
jorgenb's avatar
Level 16

Thanks! What about the the server system time? Will Horizon misbehave if there is a clock skew across the nodes?

corbosman's avatar

I doubt it, but a clock skew is never a good thing. I would always run ntp services on my servers.

flavioludi's avatar

I have the same doubt. Is it working correctly after scaling horizontally? And you about the configurations, for example, of 5 processes. Will it be 5 processes by each one of the current instances available?

Please or to participate in this conversation.