?How to optimize moodle database

?How to optimize moodle database

by mohamed salman -
Number of replies: 4

We using moodle & mysql 

My database became very large, which led to difficulty in using the site and the difficulty of transferring data if needed, knowing that I have about 7,000 users on the site and I have a large number of questions and  "mdl_logstore_standard_log" table contains millions of records 

?How can I improve the database

Average of ratings: -
In reply to mohamed salman

Re: ?How to optimize moodle database

by David Campbell -
Picture of Particularly helpful Moodlers

This forum is for the Database activity module, not the for the MySQL database. You may want to post the question to the General Help forum or the one on installing and upgrading Moodle.

In reply to David Campbell

رد: Re: ?How to optimize moodle database

by mohamed salman -
I don't want upgrade moodle, just optimizing database
In reply to mohamed salman

Re: ?How to optimize moodle database

by Ken Task -
Picture of Particularly helpful Moodlers
Assuming Linux ... install MySQLTuner -
https://github.com/major/MySQLTuner-perl
there are probably more pages like the following, but this will do:
https://www.linode.com/docs/databases/mysql/how-to-optimize-mysql-performance-using-mysqltuner/

The table mdl_logstore_standard_log is the 'who done it' log. And there are settings in
yoursite/admin/settings.php?section=logsettingstandard

Keep logs for logstore_standard | loglifetime
This specifies the length of time you want to keep logs about user activity. Logs that are older than this age are automatically deleted. It is best to keep logs as long as possible, in case you need them, but if you have a very busy server and are experiencing performance problems, then you may want to lower the log lifetime. Values lower than 30 are not recommended because statistics may not work properly.


Default is 'never delete logs' ... options are in days from 1000 days to 2 days.   Like it warns ... not lower than 30.

'SoS', Ken

Average of ratings: Useful (1)