Skip to content

Commit

Permalink
added cogwheel tests for navy-async configurations
Browse files Browse the repository at this point in the history
Summary:
This change adds three more cogwheel tests related to the Navy's async io configuration and/or
multiple clean region threads configuration

* cogwheel_cachelib_async: Navy async with io_uring
* cogwheel_cachelib_async_sync_comp: Navy async with sync completion mode (i.e., qdepth 1)
* cogwheel_cachelib_consistency_navy_with_reinsertion_multiple_clean_threads:
Navy with reinsertions, multiple region_manager threads, and consistency check

Reviewed By: therealgymmy

Differential Revision: D51861839

fbshipit-source-id: 9fc764b23e05427df7515cc8da7b220db761c5e8
  • Loading branch information
Jaesoo Lee authored and facebook-github-bot committed Dec 6, 2023
1 parent 78c6937 commit 35770f4
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"cache_config" : {
"cacheSizeMB" : 100,
"poolRebalanceIntervalSec" : 1,
"moveOnSlabRelease" : true,

"allocFactor" : 2.0,
"navyProbabilityReinsertionThreshold": 50,
"navyCleanRegions" : 2,
"navyCleanRegionThreads" : 2,
"nvmCacheSizeMB" : 512
},
"test_config" :
{

"checkConsistency" : true,

"numOps" : 1000000,
"numThreads" : 40,
"numKeys" : 1000000,


"keySizeRange" : [1, 8],
"keySizeRangeProbability" : [1.0],

"valSizeRange" : [1024, 10240],
"valSizeRangeProbability" : [1.0],

"getRatio" : 0.5,
"setRatio" : 0.5,
"delRatio" : 0.0
}
}
38 changes: 38 additions & 0 deletions cachelib/cachebench/test_configs/integration_tests/navy_async.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"cache_config" : {
"cacheSizeMB" : 100,
"poolRebalanceIntervalSec" : 1,
"moveOnSlabRelease" : true,

"allocFactor" : 2.0,
"navyProbabilityReinsertionThreshold": 50,

"nvmCachePaths" : ["/tmp/cachebench_test_nvm.img"],
"nvmCacheSizeMB" : 512,

"navyBigHashSizePct": 10,
"navySmallItemMaxSize": 1024,
"navyMaxConcurrentInserts" : 10,

"navyReaderThreads" : 4,
"navyWriterThreads" : 2,
"navyMaxNumReads" : 32,
"navyMaxNumWrites" : 32
},
"test_config" :
{
"numOps" : 10000000,
"numThreads" : 20,
"numKeys" : 1000000,

"keySizeRange" : [1, 8, 64],
"keySizeRangeProbability" : [0.3, 0.7],

"valSizeRange" : [256, 1024, 4096],
"valSizeRangeProbability" : [0.2, 0.8],

"getRatio" : 0.5,
"setRatio" : 0.5,
"delRatio" : 0.0
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"cache_config" : {
"cacheSizeMB" : 100,
"poolRebalanceIntervalSec" : 1,
"moveOnSlabRelease" : true,

"allocFactor" : 2.0,
"navyProbabilityReinsertionThreshold": 50,

"nvmCachePaths" : ["/tmp/cachebench_test_nvm.img"],
"nvmCacheSizeMB" : 512,

"navyBigHashSizePct": 10,
"navySmallItemMaxSize": 1024,
"navyMaxConcurrentInserts" : 10,

"navyReaderThreads" : 32,
"navyWriterThreads" : 32,
"navyMaxNumReads" : 32,
"navyMaxNumWrites" : 32
},
"test_config" :
{
"numOps" : 10000000,
"numThreads" : 20,
"numKeys" : 1000000,

"keySizeRange" : [1, 8, 64],
"keySizeRangeProbability" : [0.3, 0.7],

"valSizeRange" : [256, 1024, 4096],
"valSizeRangeProbability" : [0.2, 0.8],

"getRatio" : 0.5,
"setRatio" : 0.5,
"delRatio" : 0.0
}
}
8 changes: 5 additions & 3 deletions cachelib/navy/common/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,11 @@ bool AsyncIoContext::submitIo(IOOp& op) {

op.startTime_ = getSteadyClock();
while (numOutstanding_ >= qDepth_) {
XLOG_EVERY_MS(ERR, 10000) << fmt::format(
"[{}] the number of outstanding requests {} exceeds the limit {}",
getName(), numOutstanding_, qDepth_);
if (qDepth_ > 1) {
XLOG_EVERY_MS(ERR, 10000) << fmt::format(
"[{}] the number of outstanding requests {} exceeds the limit {}",
getName(), numOutstanding_, qDepth_);
}
Waiter waiter;
waitList_.push_back(waiter);
waiter.baton_.wait();
Expand Down

0 comments on commit 35770f4

Please sign in to comment.