Forum OpenACS Q&A: excessive time taken by proc

Collapse
Posted by Samer Abukhait on
Hello,

Can any body explain this message in the server log file:

Warning: sched: excessive time taken by proc 10

When and why this happens?

Collapse
Posted by Andrew Piskorski on
Yeah, it's a check, probably in AOLserver's C code somewhere (I forget and did not look just now) for how long your scheduled job ran. It ran some amount of time that AOLserver thinks is probably "too long".

You generally do not want to run slow jobs in the ns_sched thread, as no other ns_sched jobs can start until that one finishes. Instead, you want to use tell ns_sched to run the job in a newly created thread of its own where it can take as long as it wants without blocking ns_sched from starting new jobs. Thus the default warning "excessive time taken" warning message above.

Collapse
Posted by Andrew Piskorski on
Btw, it's easy to find where messages like this come from by grep'ing the code. E.g., in AOLserver 3.3+ad13:

$ find . -name "*.c" -print | xargs grep 'excessive time taken'
./nsd/sched.c:		       "excessive time taken by proc %d (%d seconds)",

Collapse
Posted by Samer Abukhait on
Shouldn’t the logged message log the name of the mentioned procedure also?
Collapse
Posted by Don Baccus on
The structure used by the scheduler doesn't include the name, just a TclHashPtr to the proc.  It's in AOLserver, not OpenACS, so there's nothing we can do about it ...