Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minProcesses and maxProcesses aren't allocated according to queue priority #1354

Closed
sts-ryan-holton opened this issue Dec 4, 2023 · 1 comment

Comments

@sts-ryan-holton
Copy link

Horizon Version

5.21.4

Laravel Version

10.34.2

PHP Version

8.1.26

Redis Driver

PhpRedis

Redis Version

7.x

Database Driver & Version

Maria DB

Description

I have several Queue Worker configurations configured in my Horizon config. fast, default and slow jobs. Each, with different queues specified in the queue array.

My slow jobs are my most important, and typically I have a lot of jobs on my uptime queue, thus why this is closer to the start.

I wanted to have a reserve "min processes" of 10 allocated here and a maximum of 55 so it can scale correctly. However, what ended up happening is it give a minimum of 10 to each queue defined in the array:

  • 10 for on-demand-runs-now
  • 9 for uptime
  • 10 for domains
  • 10 for blacklists

etc...

And uptime never went above 9. What's going on here? I need the queues to process in order, and for their to be a higher priority for processes to be allocated to uptime.

Steps To Reproduce

My config I tried:

/*
|--------------------------------------------------------------------------
| Queue Worker Configuration
|--------------------------------------------------------------------------
|
| Here you may define the queue worker settings used by your application
| in all environments. These supervisors and settings handle all your
| queued jobs and will be provisioned by Horizon during deployment.
|
*/

'defaults' => [
    'supervisor-fast-jobs' => [
        'connection' => 'redis-short-running',
        'queue' => ['on-demand-runs-now', 'cron', 'listeners', 'redis-short-running'],
        'balance' => 'auto',
        'autoScalingStrategy' => 'time',
        'maxProcesses' => 1,
        'maxTime' => 300,
        'maxJobs' => 1000,
        'memory' => 128,
        'tries' => 1,
        'timeout' => 60,
        'nice' => 0,
    ],
    'supervisor-jobs' => [
        'connection' => 'redis',
        'queue' => ['on-demand-runs-now', 'notifications', 'dns', 'certificates', 'domains-expired', 'default'],
        'balance' => 'auto',
        'autoScalingStrategy' => 'time',
        'maxProcesses' => 1,
        'maxTime' => 300,
        'maxJobs' => 1000,
        'memory' => 128,
        'tries' => 2,
        'timeout' => 70,
        'nice' => 0,
    ],
    'supervisor-slow-jobs' => [
        'connection' => 'redis-long-running',
        'queue' => ['on-demand-runs-now', 'uptime', 'domains', 'blacklists', 'subscriptions', 'redis-long-running'],
        'balance' => 'auto',
        'autoScalingStrategy' => 'time',
        'maxProcesses' => 1,
        'maxTime' => 300,
        'maxJobs' => 1000,
        'memory' => 128,
        'tries' => 1,
        'timeout' => 280,
        'nice' => 0,
    ],
],

'environments' => [
    'production' => [
        'supervisor-fast-jobs' => [
            'minProcesses' => 10,
            'maxProcesses' => 5,
            'balanceMaxShift' => 1,
            'balanceCooldown' => 3,
        ],
        'supervisor-jobs' => [
            'minProcesses' => 10,
            'maxProcesses' => 1,
            'balanceMaxShift' => 1,
            'balanceCooldown' => 3,
        ],
        'supervisor-slow-jobs' => [
            'minProcesses' => 10,
            'maxProcesses' => 55,
            'balanceMaxShift' => 5,
            'balanceCooldown' => 3,
        ],
    ],
    'local' => [
        'supervisor-fast-jobs' => [
            'minProcesses' => 10,
            'maxProcesses' => 5,
            'balanceMaxShift' => 1,
            'balanceCooldown' => 3,
        ],
        'supervisor-jobs' => [
            'minProcesses' => 10,
            'maxProcesses' => 10,
            'balanceMaxShift' => 1,
            'balanceCooldown' => 3,
        ],
        'supervisor-slow-jobs' => [
            'minProcesses' => 10,
            'maxProcesses' => 55,
            'balanceMaxShift' => 5,
            'balanceCooldown' => 3,
        ],
    ]
],
@driesvints
Copy link
Member

Hey there,

Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to open up a new issue with a link to the original one and we'll gladly help you out.

Thanks!

@laravel laravel deleted a comment from crynobone Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants