Best practice forum (Archived)

/admin/cron.php perfomance issue

 
Daniel Skripnikov
/admin/cron.php perfomance issue
by Daniel Skripnikov - Monday, 18 July 2011, 8:47 AM
 
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.
This forum post has been removed
Monday, 18 July 2011, 5:26 PM
The content of this forum post has been removed and can no longer be accessed.
Simon Coggins
Re: /admin/cron.php perfomance issue
by Simon Coggins - Monday, 25 July 2011, 7:43 PM
Group Totara

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

Simon