From 303d42533d3ffe6d4cf29bce3dded8f1e7ceb9a8 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Fri, 12 Apr 2019 19:33:59 -0500 Subject: [PATCH] BlueStore: Add onode column family KV block_cache. Signed-off-by: Mark Nelson --- src/common/PriorityCache.cc | 8 +- src/common/options.cc | 9 +- src/kv/KeyValueDB.h | 10 +++ src/kv/RocksDBStore.cc | 117 +++++++++++++++++++------ src/kv/RocksDBStore.h | 32 ++++++- src/kv/rocksdb_cache/BinnedLRUCache.cc | 7 +- src/kv/rocksdb_cache/BinnedLRUCache.h | 3 +- src/os/bluestore/BlueStore.cc | 34 ++++++- src/os/bluestore/BlueStore.h | 2 + 9 files changed, 180 insertions(+), 42 deletions(-) diff --git a/src/common/PriorityCache.cc b/src/common/PriorityCache.cc index af1fc213f324d..40ca98faba600 100644 --- a/src/common/PriorityCache.cc +++ b/src/common/PriorityCache.cc @@ -38,11 +38,11 @@ namespace PriorityCache // shrink it to 1/256 of the rounded up cache size chunk /= 256; - // bound the chunk size to be between 4MB and 32MB + // bound the chunk size to be between 4MB and 64MB chunk = (chunk > 4ul*1024*1024) ? chunk : 4ul*1024*1024; - chunk = (chunk < 16ul*1024*1024) ? chunk : 16ul*1024*1024; + chunk = (chunk < 64ul*1024*1024) ? chunk : 64ul*1024*1024; - /* Add 16 chunks of headroom and round up to the near chunk. Note that + /* FIXME: Hardcoded to force get_chunk to never drop below 64MB. * if RocksDB is used, it's a good idea to have N MB of headroom where * N is the target_file_size_base value. RocksDB will read SST files * into the block cache during compaction which potentially can force out @@ -51,7 +51,7 @@ namespace PriorityCache * compaction reads allows the kv cache grow even during extremely heavy * compaction workloads. */ - uint64_t val = usage + (16 * chunk); + uint64_t val = usage + 64*1024*1024; uint64_t r = (val) % chunk; if (r > 0) val = val + chunk - r; diff --git a/src/common/options.cc b/src/common/options.cc index 71133bdfb81d7..2033f72da3e45 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -4442,15 +4442,20 @@ std::vector