Big size of assignment and quiz overrides caches

Big size of assignment and quiz overrides caches

Iñigo Zendegi Urzelai -
Atsakymų skaičius: 10
Core developers paveikslėlis Plugin developers paveikslėlis

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!
Pažymių vidurkis: -
Atsakymas į Iñigo Zendegi Urzelai

Re: Big size of assignment and quiz overrides caches

Howard Miller -
Core developers paveikslėlis Documentation writers paveikslėlis Particularly helpful Moodlers paveikslėlis Peer reviewers paveikslėlis Plugin developers paveikslėlis
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?
Atsakymas į Howard Miller

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

Iñigo Zendegi Urzelai -
Core developers paveikslėlis Plugin developers paveikslėlis
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.
Atsakymas į Iñigo Zendegi Urzelai

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

Howard Miller -
Core developers paveikslėlis Documentation writers paveikslėlis Particularly helpful Moodlers paveikslėlis Peer reviewers paveikslėlis Plugin developers paveikslėlis

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)

Atsakymas į Howard Miller

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

Howard Miller -
Core developers paveikslėlis Documentation writers paveikslėlis Particularly helpful Moodlers paveikslėlis Peer reviewers paveikslėlis Plugin developers paveikslėlis
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
Atsakymas į Howard Miller

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

Marco Centurion -

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

Atsakymas į Marco Centurion

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

Iñigo Zendegi Urzelai -
Core developers paveikslėlis Plugin developers paveikslėlis
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).
Atsakymas į Iñigo Zendegi Urzelai

Re: Big size of assignment and quiz overrides caches

Johannes Burk -
Core developers paveikslėlis Plugin developers paveikslėlis
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...
Atsakymas į Johannes Burk

Re: Big size of assignment and quiz overrides caches

Visvanath Ratnaweera -
Particularly helpful Moodlers paveikslėlis Translators paveikslėlis
Is your OS FreeBSD by any chance?

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