mdl_log getting too big?

mdl_log getting too big?

de către Przemyslaw Stencel-
Număr de răspunsuri: 7
On our site we have a problem with user activity reports which seems to have something to do with performance (that's why I'm posting in this forum). When we try to display the activity reports, it often takes ages to display them, sometimes it's not possible to display them at all. The browser just hangs.

My guess is that it might be because of the size of the mdl_log table, which has almost 5 million entries at the moment. I see that here, at moodle.org the log lifetime is set to as little as 1 month, so this might be an indication that I'm right in my guess. If the mdl_log size is really the issue here, is there any other way around than reducing the log lifetime? We'd like to keep logs for at least half a year.

Thanks in advance,
Przemek
Media aprecierilor: -
Ca răspuns la Przemyslaw Stencel

Re: mdl_log getting too big?

de către Samuli Karevaara-
What version of Moodle are you running? Some older versions are missing indexes from mdl_log that really slow down the report pages.
Ca răspuns la Samuli Karevaara

Re: mdl_log getting too big?

de către Joan Vicent Navarro Ferreres-
The same thing happens to my me with 1.5.4 +, just now it has 10.000.000 of records and with 21000 users, is necessary to find a solution.

Some possibility? Apart from the 1.7.
Ca răspuns la Joan Vicent Navarro Ferreres

Re: mdl_log getting too big?

de către Samuli Karevaara-
See if the "info" column is indexed on it's own in mdl_log table (or as a first column of a multi column index). If not, add a single column index for it. Beware that this might jam your server for a few minutes while the DB is creating the index.
Ca răspuns la Joan Vicent Navarro Ferreres

Re: mdl_log getting too big?

de către Gary Anderson-

The main reason for logs is for users (students, teachers, and system administrators) to monitor usage of of current courses.  Hence, I have made it a practice, about a week into a new term, to delete entries from the log table for previous term.  If one does not use terms (trimesters, semesters, etc), one can still have a stratagy for deleting old records.  As truncating these records is not built into Moodle, it should be done from your database editing tool (I use SQLyog).  I would make sure to backup your database and perhaps duplicate the log table before doing this in case you make a mistake or need the logs in the future for some sort of forensics.

After doing all this deleting, I would use your SQL tool to optimize your database to make everything small and fast again.

--Gary

Ca răspuns la Gary Anderson

Re: mdl_log getting too big?

de către Samuli Karevaara-
Truncating the log table is built into Moodle. In the admin settings you can define that, for example, logs older than a year will be deleted. If you meant that the database table still takes up a lot of space after the deletion of the records, then that's true. In MySQL "OPTIMIZE TABLE mdl_log" should be executed. From the MySQL manual: "OPTIMIZE TABLE should be used if you have deleted a large part of a table..."
Ca răspuns la Samuli Karevaara

Re: mdl_log getting too big?

de către Joan Vicent Navarro Ferreres-
The option to optimize her mdl_log already has been realized, but it(he,she) has not improved the functioning.

Also I have simulated the option to create indexes in mdl_log as if it was one mdl_log 1.7 but the improvement has been minimal
My second option is to spend(pass) postsandstone and to put in a RAID the table mdl_log.

More ideas or recommendations?
Ca răspuns la Samuli Karevaara

Re: mdl_log getting too big?

de către Przemyslaw Stencel-
I'm using 1.5.3+, so, if I understand correctly, the problem should go away after the upgrade to 1.7? (which I'm planning very soon) surâs