Whats the maximum execution time of cron. is it possible to modify it if so any side effects.
The term 'Cron' refers to the automated tasks that your site runs periodically. It takes care of, for example, checking whether or not updates are available for Drupal core, and for your contributed modules, and themes.
Cron is a utility which executes commands at set intervals known as "cron jobs". According to drupal.org “A "cron job" is a time-triggered action that is usually (and most efficiently) performed by your website's hosting server, but can also be configured by a remote service or even from your own desktop”.
Cron is a daemon that executes commands at specified intervals.
Easiest - Enable Drupal cron You can manage "automated cron" via Manage > Configuration > System > Cron (admin/config/system/cron). On a new Drupal installation, this should be on by default which you can check at example.com/admin/modules. The default frequency is every three hours.
The accepted answer above is INCORRECT. Cron's time limit in Drupal is hardcoded to 240 seconds. See the drupal_cron_run
function in includes/common.inc
, specifically these lines:
drupal_set_time_limit(240);
and
if (!lock_acquire('cron', 240.0)) {
(based on the source of Drupal 7.12)
So, there is no way to change this globally without hacking core. I have heard it suggested to call drupal_set_time_limit
yourself inside of your hook_cron
implementation, as doing so resets PHP's counter. However that won't help you when it's a third-party module implementing hook_cron
.
Maximum execution time for Drupal's cron depends on your php.ini
.
For example if you use wget -O - -q -t 1 http://www.example.com/cron.php
as your cron command, apache's php.ini is used to determine the maximum execution time.
If you use php -f cron.php
as your cron command, then php-cli's php.ini is used to determine the maximum execution time.
It is recommended to use php-cli for higher execution time, where you can set the maximum execution time from /etc/php5/cli/php.ini
(if you use debian linux) and have no side effects on apache while cron runs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With