]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: make the number of alien threads configurable. 39205/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 1 Feb 2021 13:59:49 +0000 (14:59 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 1 Feb 2021 14:22:05 +0000 (15:22 +0100)
It's particularly important for reads to have large-enough
thread pool in `AlienStore` as they are synchronous; that
is, e.g. `BlueStore` blocks on IO when handling reads.

This commit introduces a configurable allowing operators
to increase the number from `1` which we were limited to
before the change.

Naming similarity with `osd_op_num_threads_per_shard` is
intentional.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/common/options.cc
src/crimson/os/alienstore/alien_store.cc

index 2cfe188a8f64f252711d85e207f198173a2e5ab5..e8cbcf2ab8e63cf3e278c1cc38a95d516042517f 100644 (file)
@@ -5519,6 +5519,11 @@ std::vector<Option> get_global_options() {
     .set_default(0)
     .set_description("The maximum number concurrent IO operations, 0 for unlimited"),
 
+    Option("crimson_alien_op_num_threads", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    .set_default(16)
+    .set_flag(Option::FLAG_STARTUP)
+    .set_description("The number of threads for serving alienized ObjectStore"),
+
     // ----------------------------
     // blk specific options
     Option("bdev_type", Option::TYPE_STR, Option::LEVEL_ADVANCED)
index cb55532545b47cdc90bb992cae5b962514dbd0cd..8b4e666b3f68d43eb6ae56f8d84885ed3616ef4b 100644 (file)
@@ -71,7 +71,9 @@ AlienStore::AlienStore(const std::string& path, const ConfigValues& values)
     logger().error("{}: unable to get nproc: {}", __func__, errno);
     cpu_id = -1;
   }
-  tp = std::make_unique<crimson::os::ThreadPool>(1, 128, cpu_id);
+  const auto num_threads =
+    cct->_conf.get_val<uint64_t>("crimson_alien_op_num_threads");
+  tp = std::make_unique<crimson::os::ThreadPool>(num_threads, 128, cpu_id);
 }
 
 seastar::future<> AlienStore::start()