feat: quotas #9

Closed
opened 2025-09-26 21:59:39 +00:00 by treadful · 1 comment
Owner

Implement per-key quotas to limit the amount of disk space each key can use.

Implement per-key quotas to limit the amount of disk space each key can use.
Author
Owner

The minio admin API has quota abilities, however, minio-rs does not implement it (some existing old unmerged PRs). So at best, it could only be set with some backend running script that runs the mc command, which isn't super ideal. Should try to KISS and optimize later.

Alternatively, maybe the server could have some central storage (S3SQL?) for keeping track of all buckets' state. It would need to be updated on every upload. Or better yet, maybe just store a _stats.json file in each bucket to keep track of its own storage written by the server upon upload.

Server-wide stats file might be useful, but also could be a potential denial of service if all uploads are forced to wait for exclusive write to the central stats object.

Ref

The minio admin API has quota abilities, however, minio-rs does not implement it (some existing old unmerged PRs). So at best, it could only be set with some backend running script that runs the `mc` command, which isn't super ideal. Should try to KISS and optimize later. Alternatively, maybe the server could have some central storage (S3SQL?) for keeping track of all buckets' state. It would need to be updated on every upload. Or better yet, maybe just store a `_stats.json` file in each bucket to keep track of its own storage written by the server upon upload. Server-wide stats file might be useful, but also could be a potential denial of service if all uploads are forced to wait for exclusive write to the central stats object. ### Ref - Conditional writes could be used to try make sure writes don't trounce each other: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-writes.html - Minio quota overview: https://github.com/minio/minio/blob/master/docs/bucket/quota/README.md - Issue tracking admin API implementation (stale) https://github.com/minio/minio-rs/issues/154 - Only way to get a bucket's usage, is to iterate all keys in a bucket and stat each object: https://github.com/minio/minio/issues/6577
treadful referenced this issue from a commit 2025-10-19 00:57:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
treadful/jot#9
No description provided.