max_cron_runtime

From the manual:
http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_6.5/Application_Framework/Helper_Classes…
cron.max_cron_runtime
DescriptionDetermines the maximum time in seconds that a single job should be allowed to run. If a single job exceeds this limit, cron.php is aborted with the long-running job marked as in progress in the job queue. The next time cron runs, it will skip the job that overran the limit and start on the next job in the queue. This limit is only enforced when cron.enforce_runtime is set to true.

I don't see a counterpart in the documentation for 7.x so I assume this still applies to v7.

I don't quite understand if the long-running job marked as in progress continues to run or is killed when the cron.php is aborted.

Can someone explain this parameter and how it impacts the cron frequency?

thanks,
FrancescaS

  • From http://support.sugarcrm.com/Documentation/Sugar_Versions/7.6/Pro/Administration_Guide/Advanced_Configuration_Options/

    Sugar's scheduler jobs are executed by the cron utility which runs on your server.  There are several configuration options available to ensure that long-running or failed scheduler jobs do not impede your other scheduler jobs from running in a timely manner. First, max_cron_runtime determines how long a single job should be allowed to run. If a single job exceeds this limit, cron.php is aborted with the long-running job marked as in progress in the job queue. The next time cron runs, it will skip the job that overran the limit and start on the next job in the queue. Additionally, if the total running time of a single cron run across all current jobs exceeds max_cron_runtime, then cron will complete whatever job it is currently executing, then stop. The next time cron runs, it will pick up with the next queued job. The max_cron_runtime uses seconds as its units and defaults to 1800 (30 minutes). You may wish to adjust this number based on the typical time requirements of scheduler jobs in your instance.By default, max_cron_runtime is not enforced on your instance. In order to enforce this limit, set enforce_runtime to true.

    $sugar_config['cron']['enforce_runtime'] = true; // default is false
    $sugar_config['cron']['max_cron_runtime'] = 1800; // seconds, default is 1800

    The timeout configuration controls how long cron will wait before re-starting a job that previously failed to complete. Once a job has been marked as in progress for longer than the timeout setting, the next cron run will mark the job as failed, making it eligible in the queue to be executed by the following cron run. The timeout uses minutes as its units and defaults to 3600 (1 hour). You may wish to adjust this number based on how quickly you wish a failed or long-running job to be reattempted. Please note that should enforce_runtime be set to false or your max_cron_runtime be longer than the timeout, a job which is running normally may be set to failed upon reaching this timeout limit.

    $sugar_config['jobs']['timeout'] = 3600; // seconds, default is 3600

    I hope this clears up your question for 7.x