-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
curvefs/client: add qos for curve-fuse, we can limits the bandwidth #2424
Conversation
cicheck |
cicheck |
@UniverseParticle |
good job(and maybe we can also limit the metadata manipulation, but we can do it in ohter pr after this done) |
curvefs/src/client/fuse_client.cpp
Outdated
@@ -143,6 +142,15 @@ CURVEFS_ERROR FuseClient::Init(const FuseClientOption &option) { | |||
warmupManager_->SetFsInfo(fsInfo_); | |||
} | |||
|
|||
ReadWriteThrottleParams params; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can dynamic throttle like diskcache throttle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, It's better this way
cicheck |
1 similar comment
cicheck |
good job. LGTM. no any more questions, except |
cicheck |
2 similar comments
cicheck |
cicheck |
|
just miss package. run "make stor=fs dep"
…---- Replied Message ----
| From | ***@***.***> |
| Date | 05/08/2023 21:48 |
| To | ***@***.***> |
| Cc | ***@***.***>、Review ***@***.***> |
| Subject | Re: [opencurve/curve] curvefs/client: add qos for curve-fuse, we can limits the bandwidth (PR #2424) |
Unit test compilation failed
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because your review was requested.Message ID: ***@***.***>
|
# the read throttle bps of fuseClient, default no limit | ||
fuseClient.throttle.avgReadBytes=0 | ||
# the read throttle iops of fuseClient, default no limit | ||
fuseClient.throttle.avgReadIops=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
burst should contains four types:
- read
- bps
- iops
- write
- bps : just this one here, we'd better add anothers.
- iops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I means we can fix this by a new pr.
curvefs/src/client/common/config.cpp
Outdated
void S3Info2FsS3Option(const curvefs::common::S3Info& s3, | ||
S3InfoOption* fsS3Opt) { | ||
void S3Info2FsS3Option(const curvefs::common::S3Info &s3, | ||
S3InfoOption *fsS3Opt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes look like only about code styles, the old and new styles in C++ are all good, we can leave them to old style, so the reviewer can pay more attentions to your added codes.
cicheck |
cicheck |
cicheck |
1 similar comment
cicheck |
|
||
throttle_.UpdateThrottleParams(params); | ||
|
||
int ret = bthread_timer_add(&throttleTimer_, butil::seconds_from_now(1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not periodic tasks? maybe can reference timer in curve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a timer task that refreshes variables once per second
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curvefs/src/client/common/config.h
Outdated
@@ -205,6 +205,34 @@ struct FuseClientOption { | |||
bool disableXattr = false; | |||
uint32_t downloadMaxRetryTimes; | |||
uint32_t warmupThreadsNum = 10; | |||
|
|||
// the write throttle bps of fuseClient | |||
uint64_t avgWriteBytes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
curvefs/src/client/common/config.cpp
Outdated
@@ -308,6 +308,35 @@ void InitFuseClientOption(Configuration *conf, FuseClientOption *clientOption) { | |||
clientOption->entryTimeOut = 0; | |||
} | |||
|
|||
|
|||
conf->GetValueFatalIfFail("fuseClient.throttle.avgWriteBytes", | |||
&clientOption->avgWriteBytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you can consider initializing FLAGS_XX directly, without going through the option to switch to one layer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I referred to the qos usage of S3 disk cache。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a situation where users only need to initialize from the configuration file and do not need to dynamically modify the qos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so, the following regular InitQosParam
will be problematic.
Even if the user does not set the value of FLAG_XX, the value read from the configuration file will be overwritten.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a situation where users only need to initialize from the configuration file and do not need to dynamically modify the qos
It can be considered that FLAG_XX is directly read in the code, and there are two sources of its assignment, one is the configuration file, and the other is the setting of the http interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fuse client initialization will read from the configuration file and assign values to FLAG_XX.
so,here you can consider initializing FLAGS_XX directly, without going through the option to switch to one layer? like:
conf->GetValueFatalIfFail("fuseClient.throttle.avgReadBytes",
&FLAG_fuseClientAvgReadBytes);
It can be considered that FLAG_XX is directly read in the code, and there are two sources of its assignment, one is the configuration file, and the other is the setting of the http interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two ways to initializing values . Is this the standard writing method in the future? (initializing FLAGS_XX directly)
@@ -1471,5 +1548,32 @@ FuseClient::SetMountStatus(const struct MountOption *mountOption) { | |||
return CURVEFS_ERROR::OK; | |||
} | |||
|
|||
void FuseClient::InitQosParam() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add new code, please add the corresponding unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
cicheck |
Signed-off-by: UniverseParticle <[email protected]>
cicheck |
1 similar comment
cicheck |
LGTM! |
What problem does this PR solve?
Issue Number: #2225
Problem Summary: add qos for curve-fuse, then we can limits the bandwidth or IOPS
What is changed and how it works?
What's Changed:
Side effects(Breaking backward compatibility? Performance regression?):
It does not start by default
Check List