-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Cron using too many resources. #26809
Comments
Hi @bobemoe. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @bobemoe do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Are you seeing cron jobs stuck in the running status? |
Just a heads up (not sure if that's the issue, but it might have been overlooked); Since Magento 2.3.3 the cron spawns several consumer processes (about 5). Each of these processes uses resources (~200Mb in RAM, not sure on the cpu but it's more than nothing). In our case it will also occasionally leave So all in all it could easily consume an additional ~1GB in memory compared to earlier versions. |
@devchris79 nothing in running status, quite a few missed though:
I did empty the cron_schedule table soon after upgrading and it only made a slight improvement. @Swahjak that could well be the issue here and would explain the increase in RAM usage. I think the increase in CPU is partly a knock on effect form the RAM (IO Wait from the swapping) Is there any way to limit the number of these consumer process? What do they do? We only use a very small number of Magento features, is it possible to disable unneeded cron services? |
We have been seeing stuck processes, but maybe its an effect of running out of ram resources on the VPS. Although I have made two changes that have so far seemed to improve things: 1, Truncated the cron log as it was getting very large
The stuck processes could be an effect of a few things happening at once, so it might require a longer period to see if things really have improved.... |
We've also disabled the Word of caution: This can delay certain processes. As an example Reading material: magento/community-features#180 #17951 |
Try to install each group separetely with locks #25987 (comment)
|
Seems like this issue is able to fix this problem #26507 |
This seems to have fixed our issues on Magento 2.3.4. When using this, be sure to check in your magento admin for additional crons that should be run for extensions. We also needed to enable some Amasty extension crons. |
#28007 can help with high CPU as it removes some deadlocks that prevent cron schedule table from being cleaned. It can also fix things stuck in running status. |
Hi @bobemoe. Thank you for your report.
The fix will be available with the upcoming 2.4.3 release. |
Not fixed. Issue still exits after real world tests with this fix |
@kilis Can you describe your concern/steps in a new issue? |
@kandy please check @ilnytskyi issue here |
@kilis: before people put more time in this, have you checked/tried this comment? |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
You can clearly see the increased load on our system graphs here. It has forced the server to start using swap. Graphs showing 12 hours before and after the M2.2.9 -> 2.3.4 upgrade. The upgrade was done at Tue 4 @ 18:00.
Same graphs but for 3 days before and 4 days after the M2.2.9 -> 2.3.4 upgrade.
I did some benchmarking on the memory and duration of the cron before and after the upgrade:
That is over double the time and memory used to do the same thing.
Measured with
while [ true ] ; do echo $(date +%s.%3N ; free | tail -n2 ) ; sleep .1 ;done | tee cron.csv
and plotted in libre office calc.2.2.9:
2.3.4:
I see similar issues here but the solutions do not make much difference:
#25634
#26507
I did truncate the cron table Wed morning... you can see on the graphs the swap usage is lowered slightly but creeps back up over the next few days, so although that may well also be an issue, I think the increase in mem usage is something different.
The text was updated successfully, but these errors were encountered: