]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Set recovery specific Ceph options for mclock profiles to work. 38675/head
authorSridhar Seshasayee <sseshasa@redhat.com>
Thu, 14 Jan 2021 13:06:04 +0000 (18:36 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Sat, 16 Jan 2021 19:09:40 +0000 (00:39 +0530)
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 <sseshasa@redhat.com>
src/osd/scheduler/mClockScheduler.cc
src/osd/scheduler/mClockScheduler.h

index 74118dca4395ddff59c9b30e72e42a005c2e3c0f..55a6055c61f16d63d404b08e18e86127ec1de7b4 100644 (file)
@@ -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);
index f6091a8734abd02a36f2890739c39923739a3f51..0517f95ffdcec46d3166ada6a63d5effba3b256e 100644 (file)
@@ -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);