]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add option mds_bal_overload_epochs 53332/head
authorZhansong Gao <zhsgao@hotmail.com>
Fri, 8 Sep 2023 09:46:37 +0000 (17:46 +0800)
committerZhansong Gao <zhsgao@hotmail.com>
Wed, 20 Sep 2023 05:47:29 +0000 (13:47 +0800)
Add an option to configure the number of epochs the overload lasts before migrating,
setting it to a higher value can avoid frequent migrations caused by load fluctuations.

Signed-off-by: Zhansong Gao <zhsgao@hotmail.com>
doc/cephfs/mds-config-ref.rst
src/common/options/mds.yaml.in
src/mds/MDBalancer.cc

index a0080ec2acb3bc7e399cfd78fe6c3d1e8cf46f4a..e578b7f251489c02b82ef336867317e9d8480b01 100644 (file)
@@ -34,6 +34,7 @@
 .. confval:: mds_bal_max_until
 .. confval:: mds_bal_mode
 .. confval:: mds_bal_min_rebalance
+.. confval:: mds_bal_overload_epochs
 .. confval:: mds_bal_min_start
 .. confval:: mds_bal_need_min
 .. confval:: mds_bal_need_max
index 5a06326f9fc8b01711a42a9821c7c8b00c425c0a..2599b6532b5dc9a16c1e345178d755ba6ec5ef75 100644 (file)
@@ -819,6 +819,16 @@ options:
   services:
   - mds
   with_legacy: true
+# must be overloaded for more than these epochs before we export anything
+- name: mds_bal_overload_epochs
+  type: int
+  level: dev
+  default: 2
+  services:
+  - mds
+  fmt_desc: The number of epochs the overload lasts before Ceph migrates,
+    setting it to a higher value can avoid frequent migrations caused by load fluctuations.
+  with_legacy: true
 # if we need less than this, we don't do anything
 - name: mds_bal_min_start
   type: float
index baa43bb43412cee90c7a659d48ff3098f7d65405..0f4f76b16d258ac88f76400db6037150228960b6 100644 (file)
@@ -766,7 +766,7 @@ void MDBalancer::prep_rebalance(int beat)
       return;
     }
     // am i over long enough?
-    if (last_epoch_under && beat_epoch - last_epoch_under < 2) {
+    if (last_epoch_under && beat_epoch - last_epoch_under < g_conf()->mds_bal_overload_epochs) {
       dout(7) << "  i am overloaded, but only for " << (beat_epoch - last_epoch_under) << " epochs" << dendl;
       return;
     }