PHPackages                             vendic/magento2-clean-cron-schedule - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vendic/magento2-clean-cron-schedule

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

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.

1.0.8(2y ago)99.4k↓100%8[1 issues](https://github.com/Vendic/magento2-clean-cron-schedule/issues)MITPHPPHP ~7.0.0|~7.1.0|~7.2.0|~7.3.0|~7.4.0|^8.1CI passing

Since Sep 6Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Vendic/magento2-clean-cron-schedule)[ Packagist](https://packagist.org/packages/vendic/magento2-clean-cron-schedule)[ RSS](/packages/vendic-magento2-clean-cron-schedule/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (10)Used By (0)

Magento 2 auto clean old cron jobs
==================================

[](#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

[](#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

[](#solving-the-problem)

Remove the old rows in `cron schedule`:

```
DELETE FROM cron_schedule WHERE  scheduled_at
