-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[8.x] Ability to slow the workers down #36521
Conversation
/** | ||
* The number of seconds to rest between jobs. | ||
* | ||
* @var int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your example is float?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to sleep. maybe in another commit we change both to float|int
.
Is the main benefit here for the SQS driver to reduce API calls? Or perhaps even have jobs accumulate resources to process like laravel/ideas#2460? |
SQS api calls are one benefit (altho a similar PR could be made to use the SQS option that keeps a connection open to up to 30 seconds or so (IIRC) to wait further jobs - "long polling" of sorts. My specific use case was wanting to throttle email sends through systems our customers use that throttle email sends over time. |
@paras-malhotra another benifit that was requested is to be able to control the rate of job processing in a limited-resources server where a burst of jops would cause the server to crash. Slowing down the processing allows the server to recover between jobs and do other things (like serve HTTP requests). |
This was a breaking change for my application which uses Laravel Horizon. We started seeing these errors when running The "rest" option does not exist.
The "rest" option does not exist.
The "rest" option does not exist.
The "rest" option does not exist. Should this be a part of upgrade notes or the changeling in some way to inform people to upgrade Laravel Horizon which includes this change? https://github.com/laravel/horizon/pull/992/files |
@dmyers what's your use case for updating the framework and not horizon? |
@driesvints I had the same issue. It was caused by our auto security checker which bumped Laravel from |
@denniseilander please update horizon as well. |
@driesvints yes, from now on I'll update horizon when laravel/framework is updated. Thanks! |
Why isn't this useful feature included in the documentation? |
@35grain Not everything is documented, as it is impossible to do IMO. |
Using the
rest
option, the worker will sleep after processing each job. This will slow down job processing.This was requested by @fideloper a few months back and I kept getting similar requests regarding it for several people so I thought I'd propose it.