-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.2.8, 4.1.10, 4.3.5, 4.4.1
-
None
-
MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE
We are using Redis as the default mapping for MUC session caches, and we have noticed the navigation_expandcourse cache in particular growing very large - up to 3GB in some cases. Given that this is just storing a boolean for each users' course, this seems ridiculously big.
I think this is happening because the cache definition has no TTL or invalidation events set. If the cache was stored in the PHP session, the data would presumably be thrown away when the session is ended, but Redis doesn't know to do this so keeps the data from old sessions until the cache is purged.
There are other session cache definitions that have no TTL or invalidation events either, so I would assume these may experience the same problem, although perhaps we havent noticed them because they don't necessarily store data for every session like navigation_expandcourse does.
I would propose we set a TTL for every session cache. It's a bit tricky to know what this should be as a session could be any length, but 24 hours seems like it would prevent data being held too long, while also covering the vast majority of genuine sessions.