Slightly decrease importance of all cron tasks #26073
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Set process priority for scheduled tasks & queue consumers to be less important than website visitors.
When the scheduled processes are run on a separate host to website visitors, this change will have little effect. When the scheduled processes are run on the same host as is used by website visitors, this change makes it less likely that a website would become unavailable when scheduled tasks (such as indexers, queue consumers, or other scheduled tasks) run an intensive process.
Due to the way that queue consumers are initialised, they will end up with a nice level of double this value*, while standard scheduled tasks (eg,
bulk_cleanup
,sales_send_order_emails
) will be run with a nice level of this value only. This actually means that queue consumers (such asexportProcessor
) will be even less important than other scheduled tasks.Fixed Issues
Manual testing scenarios
php bin/magento cron:run
ps
orhtop
on Unix. (I'm not sure what equivalent tools are available on Windows.)Questions or comments
I do not know how to write a unit test for this change.
Contribution checklist