]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/pg_autoscaler: add threshold module option
authorKyle <mcgoughboy@gmail.com>
Tue, 10 Aug 2021 22:43:52 +0000 (15:43 -0700)
committerKyle <mcgoughboy@gmail.com>
Tue, 10 Aug 2021 22:43:52 +0000 (15:43 -0700)
Signed-off-by: Kyle McGough <kmcgough@digitalocean.com>
doc/rados/operations/placement-groups.rst
src/pybind/mgr/pg_autoscaler/module.py

index d3f1c5b7430dc53e5b1dd43e2d768c173e153fdd..d282d9e5bee334ba82d4eea159c29f91d04e0983 100644 (file)
@@ -88,7 +88,10 @@ number of PGs that the pool is working towards, if a ``pg_num``
 change is in progress).  **NEW PG_NUM**, if present, is what the
 system believes the pool's ``pg_num`` should be changed to.  It is
 always a power of 2, and will only be present if the "ideal" value
-varies from the current value by more than a factor of 3.
+varies from the current value by more than a factor of 3 by default.
+This factor can be be adjusted with::
+
+  ceph config set mgr mgr/pg_autoscaler/threshold 2.0
 
 **AUTOSCALE**, is the pool ``pg_autoscale_mode``
 and will be either ``on``, ``off``, or ``warn``.
index c57a5feb35dcd067c7f40d4273cd220c638936b3..24487c7a3a3d0e82d85db103b56c30e8a2597402 100644 (file)
@@ -137,6 +137,14 @@ class PgAutoscaler(MgrModule):
                        'means starts out with full pgs and scales down when '
                        'there is pressure '),
             runtime=True),
+        Option(
+            name='threshold',
+            type='float',
+            desc='scaling threshold',
+            long_desc=('The factor by which the `NEW PG_NUM` must vary from the current'
+                       '`PG_NUM` before being accepted. Should not be less than 2.0'),
+            default=3.0,
+            min=2.0),
     ]
 
     def __init__(self, *args: Any, **kwargs: Any) -> None:
@@ -151,6 +159,7 @@ class PgAutoscaler(MgrModule):
             self.autoscale_profile: 'ScaleModeT' = 'scale-up'
             self.sleep_interval = 60
             self.mon_target_pg_per_osd = 0
+            self.threshold = 3.0
 
     def config_notify(self) -> None:
         for opt in self.NATIVE_OPTIONS:
@@ -556,9 +565,9 @@ class PgAutoscaler(MgrModule):
             osdmap: OSDMap,
             pools: Dict[str, Dict[str, Any]],
             profile: 'ScaleModeT',
-            threshold: float = 3.0,
     ) -> Tuple[List[Dict[str, Any]],
                Dict[int, CrushSubtreeResourceStatus]]:
+        threshold = self.threshold
         assert threshold >= 2.0
 
         crush_map = osdmap.get_crush()