When I try and interactively run cron.php on a website where it hasn't run for a while, it takes a long time. So long, infact, that I think the HTML connection is timing out (greater than 15 minutes).

I went through the various tables in my Drupal db (mysql), and manually deleted old rows out of tables like accesslog, cache, sessions, and watchdog, but cron.php is still taking a long time.

Is there anyway to figure out what cron.php is doing?

If there's a lot of content on the site could cron.php be spending it's time creating a search index? It looks like the load on the box goes up dramatically while cron is running. I looked at mysql using "show processlist", but didn't see any processes waiting on a lock or anything.

Also, if I use "wget" from a cron job, it looks like it can also timeout. The man page on my Mac says there's a 15 minute timeout (900 seconds). Is it reasonable to increase this timeout to 60 minutes?

Thanks in advance
Ben in DC

Comments

Hilal_Iskandar@nakoja.com.br’s picture

If you are running the pathauto module it maybe the responsible. I am getting the same problem.

Malthus’s picture

If you know php you can start debugging the problem as follows:

Modify function module_invoke_all in includes/module.inc
add "print $function;" at start of the foreach loop. Then you''ll see which module is causing the timeouts (the name of each module will be printed before its implementation of hook_cron is called.

Hope that helps.

kenorb’s picture

Try to debug it via xdebug or PhpEd.

damondt’s picture

You can try running drush cron -dwhich will give you a step by step of what cron is doing.