]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSD: Set the number of cache shards independently. Default to 32 30964/head
authorMark Nelson <mnelson@redhat.com>
Thu, 17 Oct 2019 13:50:37 +0000 (09:50 -0400)
committerMark Nelson <mnelson@redhat.com>
Tue, 22 Oct 2019 19:34:29 +0000 (15:34 -0400)
Signed-off-by: Mark Nelson <mnelson@redhat.com>
src/common/options.cc
src/osd/OSD.cc
src/osd/OSD.h

index 0ebbe4b3037cdb016196c7d162974b4bce830255..e05aa13c0e77b480d64ee4ecd242ecc0382a5517 100644 (file)
@@ -2745,6 +2745,11 @@ std::vector<Option> get_global_options() {
     .set_default(true)
     .set_description(""),
 
+    Option("osd_num_cache_shards", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
+    .set_default(32)
+    .set_flag(Option::FLAG_STARTUP)
+    .set_description("The number of cache shards to use in the object store."),
+
     Option("osd_op_num_threads_per_shard", Option::TYPE_INT, Option::LEVEL_ADVANCED)
     .set_default(0)
     .set_flag(Option::FLAG_STARTUP)
index 96aed0b706e308d3a9e8776f0f7538f3abed4786..6840d9ed7e914e38de4e7670907114b487ad6f40 100644 (file)
@@ -2803,6 +2803,11 @@ int OSD::enable_disable_fuse(bool stop)
   return 0;
 }
 
+size_t OSD::get_num_cache_shards()
+{
+  return cct->_conf.get_val<Option::size_t>("osd_num_cache_shards");
+}
+
 int OSD::get_num_op_shards()
 {
   if (cct->_conf->osd_op_num_shards)
@@ -2896,7 +2901,7 @@ int OSD::init()
   dout(2) << "journal " << journal_path << dendl;
   ceph_assert(store);  // call pre_init() first!
 
-  store->set_cache_shards(get_num_op_shards());
+  store->set_cache_shards(get_num_cache_shards());
 
   int r = store->mount();
   if (r < 0) {
index ae2fafd201fba7d85d1c1c2fb5cf625ef158fd59..f3f37d74ef8fd5b9b821bf5e82d2db4b56d69a7f 100644 (file)
@@ -2162,6 +2162,7 @@ private:
 
   int init_op_flags(OpRequestRef& op);
 
+  size_t get_num_cache_shards();
   int get_num_op_shards();
   int get_num_op_threads();