Big size of assignment and quiz overrides caches

Big size of assignment and quiz overrides caches

by Iñigo Zendegi Urzelai -
Number of replies: 10
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi there,

I've detected that in several Moodle instances I manage (Moodle 3.11.11) most of the size of the cachedir directory - around the 80% of it - came from the assign and quiz overrides, specifically cachedir/cachestore_file/default_application/mod_assign_overrides and cachedir/cachestore_file/default_application/mod_quiz_overrides directories. For example on an instance of less than 5.000 users there is more than 3GB on those two folders, more than 500.000 files in total.

For now it doesn't affect the performance of Moodle, but it's something surprising for me because our teachers create and use many assignments and quizzes but that kind of overrides are quite rare, but I haven't found any messages here or issues on the tracker around it, so my questions are:
  • Is this normal?
  • In case it isn't, is it something related with our configuration or may be an issue there?
Thanks in advance!
Average of ratings: -
In reply to Iñigo Zendegi Urzelai

Re: Big size of assignment and quiz overrides caches

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
There's a Scheduled task to removed expired Caches. By default it runs every hour.

Go to Site admin > Server > Tasks > Scheduled tasks, find "Remove expired cache entries ". When did it last run? Click the logs icon (page with folded corner) - are the tasks running without error?
Average of ratings: Useful (2)
In reply to Howard Miller

Er: Re: Big size of assignment and quiz overrides caches

by Iñigo Zendegi Urzelai -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Thanks for your answer, Howard.

I've rechecked that task and it executes with the default frequency without errors, so it doesn't seem to be a problem there.
In reply to Iñigo Zendegi Urzelai

Re: Er: Re: Big size of assignment and quiz overrides caches

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I'm not sure if it makes you feel any better. This is my site...

$ du -sh mod_assign_overrides/
5.0G mod_assign_overrides/
$ du -sh mod_quiz_overrides/
3.5G mod_quiz_overrides/

...short answer is that I don't know. I think it seems odd too. I'll need to have a dig in the code and see what these caches are doing. I'll (hopefully) be back...

(Side note: I've also found out that these are not pointing at my Redis store which makes me assume they must be recent(ish) additions)

Average of ratings: Useful (1)
In reply to Howard Miller

Re: Er: Re: Big size of assignment and quiz overrides caches

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It's something to do with this - https://tracker.moodle.org/browse/MDL-71410

These caches were added (relatively) recently. I'm guessing that nothing was implemented to invalidate the caches, so they just grow. I haven't spent long on this so it's a bit of an assumption.

Let's see - MDL-76782
Average of ratings: Useful (2)
In reply to Howard Miller

Er: Re: Er: Re: Big size of assignment and quiz overrides caches

by Iñigo Zendegi Urzelai -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
It makes sense to be related with MDL-71410 because it started when we upgraded to Moodle 3.11, so I've already voted for MDL-76782

Thank you, Howard!
In reply to Howard Miller

Re: Er: Re: Big size of assignment and quiz overrides caches

by Marco Centurion -

Have you found any workarounds for this issue? In my moodle installation we have about 90G of cache between these two directories.

In reply to Marco Centurion

Er: Re: Er: Re: Big size of assignment and quiz overrides caches

by Iñigo Zendegi Urzelai -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Marco,

Those directories are mere caches, so I would say it's quite safe to delete them because they will be rebuilt if needed (in our case they are stored on a tmpfs so they are wiped-out every time we reboot the server).
In reply to Iñigo Zendegi Urzelai

Re: Big size of assignment and quiz overrides caches

by Johannes Burk -
Picture of Core developers Picture of Plugin developers
We have a similar problem with those two cache directories. Not with the size but with inode (number of files) usage... within only some days the cache consumes ~3.000.000 inodes. Purge caches via web GUI fails (PHP script terminated because of high memory usage). Via CLI it takes some minutes and then frees nearly all inode usage. The problem occurs since we upgraded from Moodle 3.9 to 4.1.
I'm going to check out the linked tracker entries...
In reply to Johannes Burk

Re: Big size of assignment and quiz overrides caches

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Is your OS FreeBSD by any chance?

Either way the information requested here will help the people to speculate more accurately.
wink