I am working on Magento cron jobs issue. We have 50+ cron jobs in system which are scheduled and runs 24/7. But, there are some cron jobs like aoescheduler_heartbeat, aoecachecleaner, aoequotecleaner and captcha_delete_expired_images not running sometimes(ie with in 24hrs, 3 or 4 times not working). Is this due to configuration problem or memory problem or some other problem. If anyone of You know the solution, please post. Thanks in advance.
This can happen if you have one particular cron task that takes a long time to execute. For instance if you have the following settings:
- "Missed if Not Run Within" = 15
- "Schedule ahead for" = 15
Then if cron_task_1 takes 16 minutes to execute, any other tasks blocked by cron_task_1 will be marked as "missed" and a schedule may not be generated for 30 minutes instead of 15.
You need to assess your cron tasks and find the ones that are taking a long time. Check the
cron_schedule database table and look for big gaps between the
finished_at times. You may need to change your settings to allow for longer cron tasks or remove these from the Magento cron and run them separately using a tool like n98-magerun.
I'd also recommend installing AOE Scheduler to give better visibility over your cron tasks and also give you the ability to run multiple simultaneous crons.
Try this link. You should prioritize the cron jobs according to your requirements.