Best practice forum (Archived)

/admin/cron.php perfomance issue

 
Daniel Skripnikov
/admin/cron.php perfomance issue
על ידי Daniel Skripnikov בתאריך 18/07/2011, 08:47
 
Hi Everybody,

I had problem with "/admin/cron.php". Each run costs me betwing 200 and 190 seconds server time. During this time no changes can be saved to the DB.
And I had alot calls from students with subject  "very often the system halts for a while ( up to 30 seconds)".
I have Dell server with 4 Xeon 3Ghz/20Gb Ram with(Ubuntu/MySql). There is nothing except one totaralms installation.
This problem can not be a server performance issue.

After analysis I found that two SQL query take all this time. You can find them here:

/home/danil/Desktop/Work/CloudU/hierarchy/type/competency/evidenceitem/type/coursecompletion.php (line 103)
/home/danil/Desktop/Work/CloudU/hierarchy/type/competency/evidenceitem/type/activitycompletion.php (line 157)

I don't want make any deep db optimizations but I done next:
  1.     For table comp_evidence_items_evidence(in my table  469000 rows) I added index "CREATE INDEX useriditemid_ix on  {prefix}_comp_evidence_items_evidence (`userid`,`itemid`)" and run cost decreased to 26 seconds.
  2.      For table comp_evidence_items_evidence(in my table  203000 rows) I added index "CREATE INDEX   useidcriteriaid_ix on {prefix}_course_completion_crit_compl(`userid`,`criteriaid`)" and run cost decreased to 4 seconds.

I solved this issue for me and would reccomend you to include these indexes in your next update.
פרסום זה הוסר
18/07/2011, 17:26
פרסום זה הוסר ואינו זמין יותר.
Simon Coggins
Re: /admin/cron.php perfomance issue
על ידי Simon Coggins בתאריך 25/07/2011, 19:43
קבוצה Totara

These indexes have been added in release 1.0.19 (out 26th July).

Simon