OPTION(osd_disk_thread_ioprio_class, OPT_STR, "") // rt realtime be best effort idle
OPTION(osd_disk_thread_ioprio_priority, OPT_INT, -1) // 0-7
OPTION(osd_recover_clone_overlap, OPT_BOOL, true) // preserve clone_overlap during recovery/migration
-OPTION(osd_op_num_threads_per_shard, OPT_INT, 2)
-OPTION(osd_op_num_shards, OPT_INT, 5)
+OPTION(osd_op_num_threads_per_shard, OPT_INT, 0)
+OPTION(osd_op_num_threads_per_shard_hdd, OPT_INT, 1)
+OPTION(osd_op_num_threads_per_shard_ssd, OPT_INT, 2)
+OPTION(osd_op_num_shards, OPT_INT, 0)
+OPTION(osd_op_num_shards_hdd, OPT_INT, 5)
+OPTION(osd_op_num_shards_ssd, OPT_INT, 8)
OPTION(osd_op_queue, OPT_STR, "wpq") // PrioritzedQueue (prio), Weighted Priority Queue (wpq), or debug_random
OPTION(osd_op_queue_cut_off, OPT_STR, "low") // Min priority to go to strict queue. (low, high, debug_random)
goto free_store;
}
- store->set_cache_shards(cct->_conf->osd_op_num_shards);
+ store->set_cache_shards(1); // doesn't matter for mkfs!
ret = store->mount();
if (ret) {
clog(log_client.create_channel()),
whoami(id),
dev_path(dev), journal_path(jdev),
+ store_is_rotational(store->is_rotational()),
trace_endpoint("0.0.0.0", 0, "osd"),
asok_hook(NULL),
osd_compat(get_osd_compat_set()),
cct->_conf->osd_peering_wq_threads,
"osd_peering_tp_threads"),
osd_op_tp(cct, "OSD::osd_op_tp", "tp_osd_tp",
- cct->_conf->osd_op_num_threads_per_shard * cct->_conf->osd_op_num_shards),
+ get_num_op_threads()),
disk_tp(cct, "OSD::disk_tp", "tp_osd_disk", cct->_conf->osd_disk_threads, "osd_disk_threads"),
command_tp(cct, "OSD::command_tp", "tp_osd_cmd", 1),
session_waiting_lock("OSD::session_waiting_lock"),
op_queue(get_io_queue()),
op_prio_cutoff(get_io_prio_cut()),
op_shardedwq(
- cct->_conf->osd_op_num_shards,
+ get_num_op_shards(),
this,
cct->_conf->osd_op_thread_timeout,
cct->_conf->osd_op_thread_suicide_timeout,
return 0;
}
+int OSD::get_num_op_shards()
+{
+ if (cct->_conf->osd_op_num_shards)
+ return cct->_conf->osd_op_num_shards;
+ if (store_is_rotational)
+ return cct->_conf->osd_op_num_shards_hdd;
+ else
+ return cct->_conf->osd_op_num_shards_ssd;
+}
+
+int OSD::get_num_op_threads()
+{
+ if (cct->_conf->osd_op_num_threads_per_shard)
+ return get_num_op_shards() * cct->_conf->osd_op_num_threads_per_shard;
+ if (store_is_rotational)
+ return get_num_op_shards() * cct->_conf->osd_op_num_threads_per_shard_hdd;
+ else
+ return get_num_op_shards() * cct->_conf->osd_op_num_threads_per_shard_ssd;
+}
+
int OSD::init()
{
CompatSet initial, diff;
service.recovery_sleep_timer.init();
// mount.
- dout(2) << "mounting " << dev_path << " "
- << (journal_path.empty() ? "(no journal)" : journal_path) << dendl;
+ dout(2) << "init " << dev_path
+ << " (looks like " << (store_is_rotational ? "hdd" : "ssd") << ")"
+ << dendl;
assert(store); // call pre_init() first!
- store->set_cache_shards(cct->_conf->osd_op_num_shards);
+ store->set_cache_shards(get_num_op_shards());
int r = store->mount();
if (r < 0) {
int whoami;
std::string dev_path, journal_path;
+ bool store_is_rotational = true;
+
ZTracer::Endpoint trace_endpoint;
void create_logger();
void create_recoverystate_perf();
int init_op_flags(OpRequestRef& op);
+ int get_num_op_shards();
+ int get_num_op_threads();
+
public:
static int peek_meta(ObjectStore *store, string& magic,
uuid_d& cluster_fsid, uuid_d& osd_fsid, int& whoami);