From: Sridhar Seshasayee Date: Thu, 14 Jan 2021 13:06:04 +0000 (+0530) Subject: osd: Set recovery specific Ceph options for mclock profiles to work. X-Git-Tag: v16.1.0~7^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38675%2Fhead;p=ceph.git osd: Set recovery specific Ceph options for mclock profiles to work. Set and disable relevant recovery specific Ceph options for mclock profiles to work as expected. Broadly, - Set low value for recovery min cost - High values for max active recoveries and max backfills - Disable recovery sleep{_hdd, _ssd, _hybrid} Signed-off-by: Sridhar Seshasayee --- diff --git a/src/osd/scheduler/mClockScheduler.cc b/src/osd/scheduler/mClockScheduler.cc index 74118dca439..55a6055c61f 100644 --- a/src/osd/scheduler/mClockScheduler.cc +++ b/src/osd/scheduler/mClockScheduler.cc @@ -195,6 +195,9 @@ void mClockScheduler::enable_mclock_profile() ceph_assert("Invalid choice of mclock profile" == 0); return; } + + // Set recovery specific Ceph options + set_global_recovery_options(); } std::string mClockScheduler::get_mclock_profile() @@ -271,6 +274,27 @@ void mClockScheduler::set_high_client_ops_profile_config() "osd_mclock_scheduler_background_recovery_lim", stringify(rec_lim)); } +void mClockScheduler::set_global_recovery_options() +{ + // Set low recovery min cost + cct->_conf.set_val("osd_async_recovery_min_cost", stringify(100)); + + // Set high value for recovery max active and max backfill + int rec_max_active = 1000; + int max_backfills = 1000; + cct->_conf.set_val("osd_recovery_max_active", stringify(rec_max_active)); + cct->_conf.set_val("osd_max_backfills", stringify(max_backfills)); + + // Disable recovery sleep + cct->_conf.set_val("osd_recovery_sleep", stringify(0)); + cct->_conf.set_val("osd_recovery_sleep_hdd", stringify(0)); + cct->_conf.set_val("osd_recovery_sleep_ssd", stringify(0)); + cct->_conf.set_val("osd_recovery_sleep_hybrid", stringify(0)); + + // Apply the changes + cct->_conf.apply_changes(nullptr); +} + int mClockScheduler::calc_scaled_cost(op_type_t op_type, int cost) { double client_alloc = get_client_allocation(op_type); diff --git a/src/osd/scheduler/mClockScheduler.h b/src/osd/scheduler/mClockScheduler.h index f6091a8734a..0517f95ffdc 100644 --- a/src/osd/scheduler/mClockScheduler.h +++ b/src/osd/scheduler/mClockScheduler.h @@ -143,6 +143,9 @@ public: // Set "high_client_ops" profile parameters void set_high_client_ops_profile_config(); + // Set recovery specific Ceph settings for profiles + void set_global_recovery_options(); + // Calculate scale cost per item int calc_scaled_cost(op_type_t op_type, int cost);