Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the number of processes in Laravel Horizon I should use?

Tags:

laravel

I have installed Laravel Horizon to mange my queues, and inside the published config there are these settings:

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

In the processes setting:

  • How can I determine the number of processes I should use in a real world app?
  • Is there a limit?
like image 603
rook99 Avatar asked Oct 11 '18 17:10

rook99


1 Answers

This is really a guess until your application is in the real world. You need to balance acceptable wait times for jobs to kick off with projections on how often jobs will be scheduled and how long they will take to run. A reasonable upper limit is going to be heavily dependent on the hardware you're running on and the overall server workload.

It's probably not worth spending too much time on this ahead of time vs monitoring it and dialing it in as you get up and running.

like image 167
wheelmaker Avatar answered Oct 22 '22 08:10

wheelmaker