Issue Details (XML | Word | Printable)

Key: MDLSITE-701
Type: Task Task
Status: Open Open
Priority: Major Major
Assignee: Jordan Tomkinson
Reporter: Eloy Lafuente (stronk7)
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle.org Sites

Maintenance: Gather DB statistics of moodle.org (and others)

Created: 31/Mar/09 04:10 PM   Updated: 06/Apr/09 06:36 PM
Return to search
Component/s: moodle.org

Participants: Eloy Lafuente (stronk7) and Jordan Tomkinson
Security Level: None
QA Assignee: Martin Dougiamas


 Description  « Hide
In the past we used to recalculate monthly DB statistics for moodle.org database. That really helps the engine to find the best execution paths for queries.

Right now, we are executing them daily at least for this DBs:

- demo.moodle.org
- dev.moodle.org
- tracker.moodle.org
- demo.moodle.org
- demomaster.moodle.org
- talk.moodle.org

(daily, via cron, and receiving one mail with analyze results)

It would be great to add such process to moodle.org database (weekly, in a similar fashion) and other dbs here and there

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Jordan Tomkinson added a comment - 31/Mar/09 04:24 PM
Adding this to my todo list for maintenance

Jordan Tomkinson added a comment - 02/Apr/09 02:29 PM
As moodle.org now runs InnoDB this could have draw backs.

From the MySQL reference manual: For InnoDB tables, OPTIMIZE TABLE is mapped to ALTER TABLE, which rebuilds the table to update index statistics and free unused space in the clustered index.

Obviously the table is locked whilst it is being ALTER'd, rebuilding table index also takes some time.

I just ran the analyze script on the DB server and it took 28 minutes - do we still want this to be scheduled, if so on what frequency?
I think daily is too frequent, perhaps monthly would be OK to start with?


Eloy Lafuente (stronk7) added a comment - 06/Apr/09 06:36 PM
Yes, that locking is really annoying (in fact I've always thought it's a BUG, a big one).

In any case... perhaps we could do this:

1) Put moodle.org in maintenance mode* (with a nice message).
2) Run statistics
3) Put moodle.org back to normal operation

*maintenance mode is one feature within Moodle that shows one maintenance message to everybody until disabled.

About frequency... well, the often, the better (specially for InnoDB, afaik), but if weekly (sundays) is too much (causing moodle.org to be under maintenance 1/2 hour weekly), then I think we could survive with a monthly approach.

Also, perhaps... it could have sense to run statistics for some tables often, leaving some heavy tables that don't get real benefit (like logs, caches...) to be calculated less frequently.

FYC, ciao