luksak
luksak

Reputation: 3652

running cron.php thows a "maximum execution time exceeded" fatal error

I am using Drupal 6.19 with quite a lot modules. Since I added another domain using Domain Access, added a panel variant and a node type, the cron first exhausted the memory limit of 512MB. I increased this limit to 1024MB. After I have done that, the "Maximum execution time" of 240 seconds is being exceeded.

Any ideas? What additional information shpould I give?

Thanks

Lukas

Upvotes: 1

Views: 1723

Answers (3)

Finau
Finau

Reputation: 63

Look inside: includes/common.inc Line: 2716

Change the set_time_limit to a higher number such as 400.

Hope it will help someone.

Finau

Upvotes: 1

Berdir
Berdir

Reputation: 6891

Try to look for croon implementations in your modules. Disable each of these (separately) temporarily too see if it makes any difference.

Maybe a module is running in some kind of loop. A possible candidate would be search.module, that lodas all comments of a single node. If you have nodes with thousands of comments (forum posts), that could be causing this.

Upvotes: 4

James C
James C

Reputation: 14149

You should be able to raise the max execution time with set_time_limit() but I think it would be good to find out what your script is doing for four minutes!

I don't know much about this drupal script but would suggest the following:

  • Keep an eye on the database while it's running, I'm guessing that slow MySQL queries are likely to be the primary cause of it running slow
  • If slow queries aren't the cause setup some kind of profiling (would recommend xdebug + webgrind for something simple), set_time_limit() to something really high and run the script. Use the profiling data to see what's so slow and then work to optimise it.

Upvotes: 0

Related Questions