2

Hi i have a website in magento2 , in my database we have 467500 rows in cron_schedule table , my site is lacking alot and most of the time it goes down displaying server timeout issue . The configuration of my server is 18gb ram with 1 tb HDD , my database got crashed during the time of when cron jobs run , its my guess it is creating issue .

i see 462318 statuses are in pending states in my cron_schedule table out of 467500 statuses .

I just wants to know is this creating issue ? should i delete that all rows in my table for quick heal ? , as my db is crashing so much , what will be the permanent solution for this ?

1
  • Additional information request, please. Post on pastebin.com or here. A) complete (not edited) my.cnf or my.ini Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) complete MySQLTuner report if readily available AND Optional very helpful information, if available includes - htop OR top OR mytop for most active apps, ulimit -a for a linux/unix list of limits, iostat -x when system is busy for an idea of IOPS by device, df -h for a linux/unix free space list by device FOR server tuning analysis. Commented Oct 12, 2018 at 16:10

1 Answer 1

2

Magento had an issue where if one of your cron jobs takes longer than a minute to complete, it will keep starting new processes with the same tasks because it only writes the completed task to the database after all cronjobs have finished, causing a large amount of duplicate cronjobs with the status pending.

You could delete all cron jobs that are more than a day old with DELETE FROM cron_schedule WHERE created_at < DATE_SUB(NOW(), INTERVAL 1 DAY). The fix for this issue is in Magento 2.2.5, so you should upgrade if you haven't yet. If you can't upgrade yet you could run the query above in a daily cronjob as a temporary fix.

2
  • it works , useless crons deleted but the problem is still pressent i think its in my version issue 2.2 Commented Oct 8, 2018 at 12:25
  • @HamzaMustafa Any chance we could Skype TALK? Please view my profile, Network profile for contact information including my Skype ID. Commented Oct 31, 2018 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.