- startup
min: 0
max: 32
+- name: crimson_reactor_task_quota_ms
+ type: float
+ level: advanced
+ default: 0.5
+ desc: The maximum time (ms) Seastar reactors will wait between polls.
+ long_desc: The maximum time (ms) Seastar reactors will wait between polls.
+ Shorter time between pools will result in larger CPU utilization.
+ flags:
+ - startup
+- name: crimson_reactor_idle_poll_time_us
+ type: uint
+ level: advanced
+ default: 200
+ desc: Seastar's reactor idle polling time (ms) before going back to sleep.
+ long_desc: Seastar's reactor idle polling time (ms) before going back to sleep.
+ Longer reactor poll time will result in larger CPU utilization.
+ flags:
+ - startup
+- name: crimson_reactor_io_latency_goal_ms
+ type: float
+ level: advanced
+ default: 0
+ desc: The maximum time (ms) Seastar's reactor IO operations must take.
+ If not set(0 mean not set), defaults to 1.5 * crimson_reactor_task_quota_ms
+ long_desc: The maximum time (ms) Seastar's reactor IO operations must take.
+ If not set, defaults to 1.5 * crimson_reactor_task_quota_ms.
+ Increasing this value will allow more IO requests to be dispatched concurrently.
+ flags:
+ - startup
- name: crimson_osd_stat_interval
type: int
level: advanced
});
}
+struct SeastarOption {
+ std::string option_name; // Command-line option name
+ std::string config_key; // Configuration key
+ Option::type_t value_type ; // Type of configuration value
+};
+
+// Define a list of Seastar options
+const std::vector<SeastarOption> seastar_options = {
+ {"--task-quota-ms", "crimson_reactor_task_quota_ms", Option::TYPE_FLOAT},
+ {"--io-latency-goal-ms", "crimson_reactor_io_latency_goal_ms", Option::TYPE_FLOAT},
+ {"--idle-poll-time-us", "crimson_reactor_idle_poll_time_us", Option::TYPE_UINT}
+};
+
+// Function to get the option value as a string
+std::optional<std::string> get_option_value(const SeastarOption& option) {
+ switch (option.value_type) {
+ case Option::TYPE_FLOAT: {
+ if (auto value = crimson::common::get_conf<double>(option.config_key)) {
+ return std::to_string(value);
+ }
+ break;
+ }
+ case Option::TYPE_UINT: {
+ if (auto value = crimson::common::get_conf<uint64_t>(option.config_key)) {
+ return std::to_string(value);
+ }
+ break;
+ }
+ default:
+ logger().warn("get_option_value --option_name {} encountered unknown type", option.config_key);
+ return std::nullopt;
+ }
+ return std::nullopt;
+}
+
static tl::expected<early_config_t, int>
_get_early_config(int argc, const char *argv[])
{
std::begin(early_args),
std::end(early_args));
+ for (const auto& option : seastar_options) {
+ auto option_value = get_option_value(option);
+ if (option_value) {
+ logger().info("Configure option_name {} with value : {}", option.config_key, option_value);
+ ret.early_args.emplace_back(option.option_name);
+ ret.early_args.emplace_back(*option_value);
+ }
+ }
if (auto found = std::find_if(
std::begin(early_args),
std::end(early_args),