Massive mdl_sessions2 table

Massive mdl_sessions2 table

by Robert Emery -
Number of replies: 4
Hi all,

In the mySQL database, there is an enormous mdl_session2 (600mb with ~244000 records), however I can't find any information about what it is or how I can clean it up safely.

Does anyone have an info on this?

Thanks

-Rob
Average of ratings: -
In reply to Robert Emery

Re: Massive mdl_sessions2 table

by Robert Emery -
In case anyone ever requires this, in the end I just wiped out everything that expired > 2 days ago:

DELETE FROM mdl_sessions2 WHERE DATEDIFF(NOW(),expiry)>2;

from mysqlAdministrator, no adverse effects so I think that's ok!


In reply to Robert Emery

Re: Massive mdl_sessions2 table

by Cristian Alvarado -
We have this issue as well, and our system administrators had to wipe the session table completely during one of our maintenance windows.

Does anyone else have this issue, or is this just a side effect of running a large Moodle site?

The second question is, does Moodle automatically wipe this table every so often, or is it something that has to be done manually?

For reference, we are running Moodle 1.9.5+, and have 45,000 "active" users. In the three months since we upgraded to 1.9.5+, our sessions table grew to over 12GB in size.
In reply to Robert Emery

Re: Massive mdl_sessions2 table

by Paul Ortman -
I've reported this as a bug in the tracker: MDL-21176

We're experiencing the same thing and it seems to be tied with the admin setting dbsessions.