vendic / magento2-clean-cron-schedule
Magento 2.2 has issues with giant `cron_schedule` tables. The cron job running time will increase when the table gets bigger, causing heavy CPU usage.
Installs: 8 443
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 4
Forks: 6
Open Issues: 1
Type:magento2-module
Requires
- php: ~7.0.0|~7.1.0|~7.2.0|~7.3.0|~7.4.0|^8.1
- magento/framework: ^101.0.0|^102.0.0|^103.0.0
- magento/magento-composer-installer: *
README
Magento 2.2 has issues with giant cron_schedule
tables. The cron job running time will increase when the table gets bigger, causing heavy CPU usage.
Identifing the problem
In one of our stores the cron_schedule
table exeeded 1.000.000 rows. To identify the problem run the following SQL query:
SELECT count(*) FROM `cron_schedule`
Solving the problem
Remove the old rows in cron schedule
:
DELETE FROM cron_schedule WHERE scheduled_at < Date_sub(Now(), interval 24 hour);
This module will execute the cleanup query once a day.
Installation
composer require vendic/magento2-clean-cron-schedule
Related issues
About Vendic
Vendic - Magento 2 develops technically challenging e-commerce websites using Magento 2. Feel free to check out our projects on our website.