We recently upgraded to moodle 3.5 from 3.1.
We're getting some periodic service disruptions and trying to figure out what is causing it. Some leads we have are that when the scheduled task context_cleanup_tasks or session_cleanup_task runs, that is when we have the service disruption.
The query in the context_cleanup_tasks involved a big union statement and running it manually it sometimes takes close to 10 seconds. But the slow query log doesn't show it ever taking quite that long.
The slowest queries of all are when a single row is inserted into mdl_sessions. Up to 140 seconds or more! I thought we were storing the sessions on the file system. Why would it be writing to the database? Is there a new configuration setting I need to set in config.php to make sure session data is only stored on the file system and not in the database?