Skip to content

Commit

Permalink
Add cachebench test configs with large cache size
Browse files Browse the repository at this point in the history
Summary:
We ran the following configuration configuration on CacheBench on a machine with 1.2TB of RAM to test if we can create large caches using the 5-byte compressed pointer.

This we ran on T2:

===JSON Config===
{
  "cache_config": {
    "cacheSizeMB": 820616,
    "allocSizes": [4194304],
    "allocator": "LRU5B2Q"
  },
  "test_config":
    {
      "name": "stressor",
      "enableLookaside": true,
      "getRatio": 0.7684563460126871,
      "keySizeRange": [
        1,
        8,
        64
      ],
      "keySizeRangeProbability": [
        0.3,
        0.7
      ],
      "loneGetRatio": 0.2315436539873129,
      "numKeys": 1000000,
      "numOps": 5000000,
      "numThreads": 32,
      "valSizeRange": [
        4190000,
        4194000
      ],
      "valSizeRangeProbability": [
        1.0
      ]
    }

}

Welcome to FB-internal version of cachebench
Created 885,900 keys in 0.00 mins
Generating 160.00M sampled accesses
Generated access patterns in 0.02 mins
Total 160.00M ops to be run
09:30:29       0.00M ops completed. Hit Ratio   0.00% (RAM   0.00%, NVM   0.00%), 0 items in cache
09:31:29       0.70M ops completed. Hit Ratio  13.34% (RAM  13.34%, NVM   0.00%), 205121 items in cache
09:32:29       2.65M ops completed. Hit Ratio  15.54% (RAM  15.54%, NVM   0.00%), 205121 items in cache
09:33:29       4.60M ops completed. Hit Ratio  15.60% (RAM  15.60%, NVM   0.00%), 205121 items in cache

Reviewed By: haowu14

Differential Revision: D68662795

fbshipit-source-id: f0e11df50aef4010bbf6ce58d1cc72f12d9cac85
  • Loading branch information
Pranav Bhandari authored and facebook-github-bot committed Feb 24, 2025
1 parent 41d0173 commit bc71876
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 6 deletions.
5 changes: 3 additions & 2 deletions cachelib/cachebench/runner/ProgressTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ void ProgressTracker::work() {
auto [overallHitRatio, ramHitRatio, nvmHitRatio] =
currCacheStats.getHitRatios(prevStats_);
auto thStr = folly::sformat(
"{} {:>10.2f}M ops completed. Hit Ratio {:6.2f}% "
"(RAM {:6.2f}%, NVM {:6.2f}%)",
"{} {:>10.2f}M ops completed. {} items in cache. Hit Ratio {:6.2f}% "
"(RAM {:6.2f}%, NVM {:6.2f}%).",
buf,
mOpsPerSec,
currCacheStats.numItems,
overallHitRatio,
ramHitRatio,
nvmHitRatio);
Expand Down
8 changes: 4 additions & 4 deletions cachelib/cachebench/runner/Stressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ std::unique_ptr<Stressor> Stressor::makeStressor(
} else if (cacheConfig.allocator == "LRU5B") {
return std::make_unique<AsyncCacheStressor<Lru5BAllocator>>(
cacheConfig, stressorConfig, std::move(generator));
} else if (cacheConfig.allocator == "LRU2Q5B") {
} else if (cacheConfig.allocator == "LRU5B2Q") {
return std::make_unique<AsyncCacheStressor<Lru5B2QAllocator>>(
cacheConfig, stressorConfig, std::move(generator));
}
Expand All @@ -214,10 +214,10 @@ std::unique_ptr<Stressor> Stressor::makeStressor(
return std::make_unique<CacheStressor<Lru2QAllocator>>(
cacheConfig, stressorConfig, std::move(generator));
} else if (cacheConfig.allocator == "LRU5B") {
return std::make_unique<AsyncCacheStressor<Lru5BAllocator>>(
return std::make_unique<CacheStressor<Lru5BAllocator>>(
cacheConfig, stressorConfig, std::move(generator));
} else if (cacheConfig.allocator == "LRU2Q5B") {
return std::make_unique<AsyncCacheStressor<Lru5B2QAllocator>>(
} else if (cacheConfig.allocator == "LRU5B2Q") {
return std::make_unique<CacheStressor<Lru5B2QAllocator>>(
cacheConfig, stressorConfig, std::move(generator));
}
}
Expand Down
40 changes: 40 additions & 0 deletions cachelib/cachebench/test_configs/large_cache_test/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"cache_config": {
"cacheSizeMB": 220616,
"allocSizes": [262144, 524288, 1048576, 4194304],
"allocator": "LRU5B2Q"
},
"test_config":
{
"name": "stressor",
"enableLookaside": true,
"getRatio": 0.7684563460126871,
"keySizeRange": [
1,
8,
64
],
"keySizeRangeProbability": [
0.3,
0.7
],
"loneGetRatio": 0.2315436539873129,
"numKeys": 125000,
"numOps": 600000,
"numThreads": 16,
"valSizeRange": [
260000,
524000,
1040000,
4190000,
4194000
],
"valSizeRangeProbability": [
0.25,
0.25,
0.25,
0.25
]
}

}

0 comments on commit bc71876

Please sign in to comment.