Systematic cleanup of relay download cache

Is there a way to systematically clear the relay download cache and relay action caches of older unused content? I have several relays that are low on disk space and according to the BES Relay Cache analysis their caches are 30GB or higher or is it better to simply reduce the cache size and let BigFix reduce it. The max size of the caches is currently 100GB but this is on desktop computers mostly which only have 120GB drives.

Probably much easier to reduce the cache limit and let the Relay handle purging the older content.

You could write a script to delete the older files from sha1, but that isn’t guaranteed to be “unused” content. A download could be months old, but still used by clients and that’s hard to catch. You’d have to use SQLite to inspect the download requests database and see which downloads are still being requested by clients – that’s what our Relay process uses, so it’s much simpler to just let the Relay do that for you.

In any case of you delete things that are still being requested the Relay will just download it again anyway.

Thanks for the sanity check. I’ll reduce the max cache size to something more reasonable like 20GB then.

Oh one more question. Once the change is made does the cache get purged immediately or is there a scheduled maintenance. So for example if the cache size is currently 45GB and I reduce the max to 20GB does it reduce right away and start deleting or does this happen on an interval?

I’d have to page @AlanM on that. I think the relay download cleanup runs once a day, but it’s possible that restarting the Relay service could hurry it along.

Perfect thanks. I actually reduced one of them to 20GB to test it out at 11:14am and it had removed it by 1:59pm local time.

1 Like