1

My problem:

I'm trying to debug a CRON that is only hitting maximum execution time exceeded at a certain time. My theory is that it's running in the same process as some heavy Magento CRON process and that process hitting the maximum execution time is causing the register_shutdown_function() in my CRON to trigger, sending me an annoying email every night.

Example:

<crontab>
    <jobs>
        <kungfoo>
            <schedule><cron_expr>0 10 * * *</cron_expr></schedule>
            <run><model>kungfoo/do::things</model></run>
        </kungfoo>
        <heavy_cron>
            <schedule><cron_expr>0 10 * * *</cron_expr></schedule>
            <run><model>heavy_cron/do::lots_of_things</model></run>
        </heavy_cron>
    </jobs>
</crontab>

Question:

Will Magento run these both in the same PHP process, or does it use a separate PHP process for each one.

2 Answers 2

1

From Magento doc (scroll down to the bottom of the doc page)

http://devdocs.magento.com/guides/v2.0/config-guide/cron/custom-cron-ref.html

Separate process for cron job is available only for Magento 2.1 and later.

2

Not sue if your looking for this, but with Aoe_Scheduler you can also split your cron jobs into different groups.

From documentation:

Aoe_Scheduler is capable of splitting your cron jobs into different groups so you can run them in parallel or distribute them on multiple servers. Running multiple scheduler jobs in parallel is quite handy when you have some jobs which take a long time to run, and are not crucial for shop to run properly. An example could be a job which generates some kind of reports. Aoe Scheduler comes with whitelist/blacklist feature enabling you to do so.

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.