-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Cronjobs increasing CPU usage and slow queries #26507
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
Comments
Hi @Zyles. 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. @Zyles do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Do ypu have any jobs stuck "running" |
If you manually delete the rows that are stuck running, the pending jobs should be cleaned back to normal levels over the next few cron runs. |
But you need to look at why they do not complete. It would be better if magento had some timeout to terminate stuck running jobs. |
I have deleted them out before, but they returned (as I suppose you would expect). I will try again and try to understand the sticking. I agree with the timeout to terminate stuck routines, that would be great. I also don't understand why we have routines stuck in the "running" state with no execution time stamp, surely that should be the first thing done.... |
Didn't check "running". Truncated table as it took up too much server resources. Clearly a bug. One should not routinely have to empty the table manually. |
Hi @engcom-Hotel. Thank you for working on this issue.
|
✅ Confirmed by @engcom-Hotel Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
I have tweaked my cron job setup slightly and so far there hasn't been any sticking in the running state. I am wondering if its possible that two or more instances of the same cron job are being run at the same time and if that's causing lockup. |
hi @devchris79 we are also facing same issue with Magento 2.3.2 Could you please let us know your changes. Thank you |
Hi @anil90 we are still seeing the issues. I think the timing is a red herring. |
The issue #26809 contains a post that highlights the extra ram usage in the cron processes from Magento 2.3.3. Our site currently has no jobs stuck in the running state for over a day, and I have only made two changes: 1, Truncated the cron log as it was getting very large
|
@devchris79 Please keep me up to date with the status of your cron job processes. You can use the https://github.com/kiwicommerce/magento2-cron-scheduler to kill your cron job after the cron job runs for 3 hours. |
@roni-sooryen Happy to report that we still have nothing stuck :-) |
Seems like this is the same issue here #22438 |
I've had more success using separate intervals on cronjob, so they do not lock into each other. This is on a medium store. On a large store the problem should be even more severe since the cronjobs run for longer. Example:
Also turning off separate processes for each cronjob in backend: This is by no means a fix, rather a workaround and works for us right now. |
Hi @Zyles. Thank you for your report.
The fix will be available with the upcoming 2.4.3 release. |
Still happens in 2.4.2 |
Cronjobs stuck in pending state. CPU usage increasing. Mysql slow queries increasing.
Time is 13:28.
Logs filled with:
Load goes down after disabling cronjob in crontab:
Preconditions (*)
Magento 2.3.3 & 2.4-develop
PHP-FPM 7.2.24
Steps to reproduce (*)
Expected result (*)
Normal working store.
Actual result (*)
The text was updated successfully, but these errors were encountered: