Affects Version/s: 3.3.7, 3.4.4, 3.5.1
Fix Version/s: None
Mysql connections to external logstore are not reused/cached, so the amount of mysql connections is increasing.
This can best be seen during automated course backup. Every database reading creates a new database connection. This connections are terminated when backup process is finished.
Use a global variable $DBEXT like $DB, where the external mysql connection is cached.
- Create a database other than your Moodle database.
- Create a table in the above database identical to the logstore_standard in your Moodle database.
- Go to Site administration ► Plugins ► Logging ► Manage log stores
- Enable External database log
- Go to settings for the external logstore
- Enter your external database and table details and save
- Click on "Test connection" and make sure you can successfully connect to the database table.
- Go to Site administration ► Courses ► Backups ► Automated backup setup
- Set backup_auto_active to "Enabled"
- Set backup_auto_logs to "Yes"
- Perform an automated backup on cli: php admin/cli/automated_backups.php
- While backup is running, observer the processes on Mysql console / PHPMyAdmin: show processlist;