Description
This is trying to collect some related ideas and get feedback about these and maybe other options.
space usage (implementable via borgstore)
One obvious thing that can be done in relatively simple way is that the borgstore user uses .list()
to get infos about all items and sums up the item sizes.
This will give the net space usage. The gross usage will be higher than that due to fs block size and other overheads.
This operation is relatively expensive if there are many items, but the borgstore user might have to iterate over all items for some other purposes anyway, so the space usage can be computed as a side effect of these other operations.
reserved allocated space (implementable via borgstore)
To avoid catastrophic "disk full" issues, borgstore users can just store some big items into the store. These can be freed in emergency situations to make free space available.
disk free (a la df / vfsstat)
This has some issues:
- vfsstat only implementable for local and sftp store
- vfsstat does not consider fs quotas
- df would require executing a shell command, parsing its output
- reported values are for the filesystem, not necessarily for the user (there might be other users using space, there might be usrquota/grpquota)
quota (as it could be implemented by borgstore)
quota use: see space usage
quota limit: this could only be implemented if there is a server side borgstore component enforcing this, that is not controlled by the client.
but as this would be implemented per borgstore, it is not necessarily very useful for storage providers if the user could create an arbitrary amount of borgstores.
quota (filesystem user/group quota)
Some filesystems on POSIX OSes like Linux support usrquota / grpquota.
quota use:
- querying usually requires executing a shell command and parsing its output, which is rather undesirable.
- there might be differences depending on the OS and tool.
- would account for fs overheads also
quota limit:
- admin can usually set soft and hard limits
- limits are per user (thus, for all borgstores of that user)
quota (cloud)
Not sure whether / how they implement that.