Skip to content

Commit

Permalink
curvefs: enable async read for FileCacheManager::ReadKVRequest
Browse files Browse the repository at this point in the history
Signed-off-by: Ziy1-Tan <ajb459684460@gmail.com>
  • Loading branch information
Ziy1-Tan committed May 8, 2023
1 parent 5f4acca commit 1edc384
Show file tree
Hide file tree
Showing 14 changed files with 238 additions and 172 deletions.
2 changes: 2 additions & 0 deletions curvefs/conf/client.conf
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ s3.threadScheduleInterval=3
s3.cacheFlushIntervalSec=5
s3.writeCacheMaxByte=838860800
s3.readCacheMaxByte=209715200
# file cache read thread num
s3.readCacheThreads=5
# http = 0, https = 1
s3.http_scheme=0
s3.verify_SSL=False
Expand Down
1 change: 1 addition & 0 deletions curvefs/src/client/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ cc_library(
"//curvefs/src/common:dynamic_vlog",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/meta:type_traits",
"@com_google_absl//absl/types:optional",
"@com_google_googletest//:gtest_prod",
Expand Down
2 changes: 2 additions & 0 deletions curvefs/src/client/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ void InitS3Option(Configuration *conf, S3Option *s3Opt) {
&s3Opt->s3ClientAdaptorOpt.writeCacheMaxByte);
conf->GetValueFatalIfFail("s3.readCacheMaxByte",
&s3Opt->s3ClientAdaptorOpt.readCacheMaxByte);
conf->GetValueFatalIfFail("s3.readCacheThreads",
&s3Opt->s3ClientAdaptorOpt.readCacheThreads);
conf->GetValueFatalIfFail("s3.nearfullRatio",
&s3Opt->s3ClientAdaptorOpt.nearfullRatio);
conf->GetValueFatalIfFail("s3.baseSleepUs",
Expand Down
1 change: 1 addition & 0 deletions curvefs/src/client/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ struct S3ClientAdaptorOption {
uint32_t flushIntervalSec;
uint64_t writeCacheMaxByte;
uint64_t readCacheMaxByte;
uint32_t readCacheThreads;
uint32_t nearfullRatio;
uint32_t baseSleepUs;
uint32_t maxReadRetryIntervalMs;
Expand Down
4 changes: 3 additions & 1 deletion curvefs/src/client/fuse_s3_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ CURVEFS_ERROR FuseS3Client::Init(const FuseClientOption &option) {
auto fsCacheManager = std::make_shared<FsCacheManager>(
dynamic_cast<S3ClientAdaptorImpl *>(s3Adaptor_.get()),
opt.s3Opt.s3ClientAdaptorOpt.readCacheMaxByte,
opt.s3Opt.s3ClientAdaptorOpt.writeCacheMaxByte, kvClientManager_);
opt.s3Opt.s3ClientAdaptorOpt.writeCacheMaxByte,
opt.s3Opt.s3ClientAdaptorOpt.readCacheThreads,
kvClientManager_);
if (opt.s3Opt.s3ClientAdaptorOpt.diskCacheOpt.diskCacheType !=
DiskCacheType::Disable) {
auto s3DiskCacheClient = std::make_shared<S3ClientImpl>();
Expand Down
1 change: 1 addition & 0 deletions curvefs/src/client/s3/client_s3_adaptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ S3ClientAdaptorImpl::Init(
<< ", flushIntervalSec: " << option.flushIntervalSec
<< ", writeCacheMaxByte: " << option.writeCacheMaxByte
<< ", readCacheMaxByte: " << option.readCacheMaxByte
<< ", readCacheThreads: " << option.readCacheThreads
<< ", nearfullRatio: " << option.nearfullRatio
<< ", baseSleepUs: " << option.baseSleepUs;
// start chunk flush threads
Expand Down
Loading

0 comments on commit 1edc384

Please sign in to comment.