]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/Bluestore: target_bytes should scale with meta/data ratios. 15708/head
authorMark Nelson <mnelson@redhat.com>
Thu, 15 Jun 2017 13:23:23 +0000 (08:23 -0500)
committerMark Nelson <mnelson@redhat.com>
Thu, 15 Jun 2017 13:23:23 +0000 (08:23 -0500)
Signed-off-by: Mark Nelson <mnelson@redhat.com>
src/os/bluestore/BlueStore.cc

index e89986833920896c961c6d4e1bbdc1c5cbfad872..88f986a9dc22995d08a9a7c6a2cedc084ee63088 100644 (file)
@@ -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,