The Home for Magento 2 Excellence

Quality-tested Magento 2 modules. Explore. Evaluate. Elevate. #magento2

1090 Modules
617 Ready
473 Need Help
🏆 Leaderboard
Potentially Abandoned v1.0.8

Magento 2 Clean Cron Schedule

vendic/magento2-clean-cron-schedule

Automatically removes stale rows from the cron_schedule table once a day, preventing it from growing huge and causing slow cron runs and heavy CPU usage.

9,584
Downloads
Below average
9
GitHub Stars
Below average
2y ago
Last Release
1
Open Issues
Build Passing
Ready to install

Build Tests

Composer Install
DI Compile
Templates

Code Quality

CS Coding Standard
3 warnings
L5 PHPStan

Tested on Magento 2.4.9

Recent Test History

Each release is tested against the latest Magento version at that time.

v1.0.8 on Magento 2.4.9
Jun 3, 2026

Share This Module's Status

Magento 2 Clean Cron Schedule Magento compatibility status badge

README

Loaded from GitHub

Magento 2 auto clean old cron jobs

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);

Source

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.

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.