mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 05:16:00 +03:00
[PR #2351] [MERGED] s3fs: add option free_space_ratio to control cache size #2494
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#2494
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2351
Author: @adamqqqplay
Created: 10/18/2023
Status: ✅ Merged
Merged: 10/20/2023
Merged by: @ggtakec
Base:
master← Head:enhance-cache📝 Commits (2)
4f1a87bTry to cleanup cache directory when initing without enough disk space189f957s3fs: add option free_space_ratio to control cache size📊 Changes
5 files changed (+117 additions, -11 deletions)
View changed files
📝
doc/man/s3fs.1.in(+6 -0)📝
src/fdcache.cpp(+44 -5)📝
src/fdcache.h(+4 -0)📝
src/s3fs.cpp(+54 -6)📝
src/s3fs_help.cpp(+9 -0)📄 Description
Relevant Issue (if applicable)
Many users complain that s3fs cannot effectively manage cache space growth. Users can usually use ensure_diskfree to reserve a certain amount of remaining space. But with this option, s3fs sometimes fails to start due to insufficient space, so we need an easier-to-use option.
This PR is a small enhancement to #280 to alleviate the issue.
Details
Since the ensure_diskfree option is not convenient enough, we have added a new option "-o free_space_ratio" to control the space used by the s3fs cache based on the current disk size.
The value of this option can be between 0 and 100. It will control the size of the cache according to this ratio to ensure that the idle ratio of the disk is greater than this value.
For example, when the value is 10 and the disk space is 50GB, it will ensure that the disk will reserve at least 50GB * 10% = 5GB of remaining space.
Also optimize log messages to print detailed errors to the user.
I'm not sure if some behavior modifications are appropriate, please give me some suggestions, thanks in advance!
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.