From 50e07f0dabf1337276a987c0bfb099a2d6ac2e39 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 15 Jun 2017 08:23:23 -0500 Subject: [PATCH] os/Bluestore: target_bytes should scale with meta/data ratios. Signed-off-by: Mark Nelson --- src/os/bluestore/BlueStore.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e899868339208..88f986a9dc229 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3256,7 +3256,9 @@ void *BlueStore::MempoolThread::entry() float bytes_per_onode = (float)meta_bytes / (float)onode_num; size_t num_shards = store->cache_shards.size(); - uint64_t shard_target = store->cct->_conf->bluestore_cache_size / num_shards; + float target_ratio = store->cache_meta_ratio + store->cache_data_ratio; + // A little sloppy but should be close enough + uint64_t shard_target = target_ratio * (store->cct->_conf->bluestore_cache_size / num_shards); for (auto i : store->cache_shards) { i->trim(shard_target, -- 2.39.5