Skip to content

Scaling delayed or doesn't happen at all #667

Closed
@rafalglowacz

Description

@rafalglowacz
  • Horizon Version: v3.3.2
  • Laravel Version: 5.8.22
  • PHP Version: 7.2.4
  • Redis Driver & Version: phpredis 4.3.0
  • Database Driver & Version: MySQL 5.7.22

Description:

When Horizon is freshly started and all workers have been scaled down then scaling only happens after the first job finishes (which might be a long time) or, if minProcesses is set to 0, it never happens, no jobs get processed. I thought I was doing something wrong but I asked a colleague to check it for me and he got the same results.

Steps To Reproduce:

  • have a supervisor config like this:
'supervisor-3' => [
	'connection' => 'redis',
	'queue' => ['myqueue'],
	'balance' => 'auto',
	'minProcesses' => 1, // or 0
	'maxProcesses' => 10,
	'tries' => 1,
	'timeout' => 24 * 3600,
],
  • clear Redis for good measure
  • start Horizon
  • crucial: wait for all workers for myqueue to scale down to the min number (for instance watch 'ps faux | grep horizon')
  • put a job in myqueue - make it run for half a minute or so in order to see what happens next
  • put another job in myqueue
  • depending on minProcesses:
    • if it was 1, the second job (and any subsequent job) won't start until the first one is done. After that happens, it'll work as expected. If the workers scale down to minimum now, it'll also work fine. The problem is only with the first job after starting Horizon and initially scaling down to minimum.
    • if it was 0, no worker processes will start and no jobs will be executed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions