crimson: make the number of alien threads configurable.

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>
This commit is contained in:
Radoslaw Zarzynski 2021-02-01 14:59:49 +01:00
parent 72cc819b3a
commit 387834bae9
2 changed files with 8 additions and 1 deletions

View 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)

View 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()