The MediaRetention setting should be expanded to include a max size option for the total combined files of remote media. Once this size is reached it should either wipe the remote media or stop uploading remote content to the storage backend.
Perhaps it could wipe the oldest first and go from there to free up space?
This is a decent idea. There's a bunch of other ideas various people have brought up over the last couple months, all of them (including this one) are gonna be investigated further when I've refactored the drive system a bit more (splitting blob and file storage, etc.).
https://git.0x0.st/mia/0x0/issues/9 there are some more ideas (I don’t see the need for anything that sophisticated but maybe these are worth considering for an AP server)
I’d suggest using an approach similar to what I do on https://0x0.st: There is a minimum and maximum retention time, and the exact value is picked relative to the configured maximum file size, with a cubic falloff. So bigger files expire much sooner than smaller files.
At least for my file hosting site, this has been working really well in terms of resource optimization because it roughly matches usage patterns: Pretty often, bigger files get more hits than smaller ones, but smaller files are shared over a longer period of time.