Skip to content
New issue

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

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

Already on GitHub? # to your account

Prevent pool to receive more than available processes on scaling #1096

Merged
merged 1 commit into from
Nov 16, 2021
Merged

Prevent pool to receive more than available processes on scaling #1096

merged 1 commit into from
Nov 16, 2021

Conversation

ferdinandfrank
Copy link
Contributor

As described in #897 a queue might currently scale down to 0 processes even though a minimum amount of processes per queue is configured.
I observed the behavior especially when one queue needs to process a lot of jobs over a longer period of time (system_function in the screenshot). In that case it sometimes receives all processes from other busy queues (low in the screenshot) which leads to the other busy queue (low) receiving 0 processes as all others are already busy even though the minProcesses in the config is set to 3.
image

To prevent this issue this pull request ensures that a queue will not receive more than the available processes when scaling up by considering the configured minProcesses and the amount of configured queues using the following formula:
[maxProcesses] - (([amount of queues] - 1) * [minProcesses])

This ensures that every queue has the configured amount of minProcesses available.

@taylorotwell taylorotwell merged commit 68e7e3d into laravel:5.x Nov 16, 2021
@taylorotwell
Copy link
Member

Thanks for contributing to Laravel! ❤️

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants