From: Zhansong Gao Date: Fri, 8 Sep 2023 09:46:37 +0000 (+0800) Subject: mds: add option mds_bal_overload_epochs X-Git-Tag: v19.0.0~345^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=17ae57daef1b9a8392b6c5604ece4578252652e3;p=ceph.git mds: add option mds_bal_overload_epochs 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 --- diff --git a/doc/cephfs/mds-config-ref.rst b/doc/cephfs/mds-config-ref.rst index a0080ec2acb3..e578b7f25148 100644 --- a/doc/cephfs/mds-config-ref.rst +++ b/doc/cephfs/mds-config-ref.rst @@ -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 diff --git a/src/common/options/mds.yaml.in b/src/common/options/mds.yaml.in index 5a06326f9fc8..2599b6532b5d 100644 --- a/src/common/options/mds.yaml.in +++ b/src/common/options/mds.yaml.in @@ -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 diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index baa43bb43412..0f4f76b16d25 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -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; }