]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/pg_autoscale: revert to default profile scale-up 43999/head
authorKamoltat <ksirivad@redhat.com>
Wed, 17 Nov 2021 20:34:48 +0000 (20:34 +0000)
committerKamoltat <ksirivad@redhat.com>
Fri, 19 Nov 2021 18:55:36 +0000 (18:55 +0000)
pg_autoscale module will now start out all the pools
with a scale-up profile by default.

Added tests in workunits/mon/pg_autoscaler.sh
to evaluate if the default pool creation is
a scale-up profile

Updated documentation and release notes to
reflect the change in the default behavior
of the pg_autoscale profile.

Fixes: https://tracker.ceph.com/issues/53309
Signed-off-by: Kamoltat <ksirivad@redhat.com>
PendingReleaseNotes
doc/rados/operations/placement-groups.rst
qa/workunits/mon/pg_autoscaler.sh
src/mon/KVMonitor.cc
src/pybind/mgr/pg_autoscaler/module.py

index afabe2b162b8a03e67d46b0edc7b24a0a9cb1075..d210723fc861e5370adbd90a023abed5c06cb786 100644 (file)
@@ -66,9 +66,9 @@
   The POST notification at the beginning of the upload, and PUT notifications that 
   were sent on each part are not sent anymore.
 
-* MGR: The pg_autoscaler has a new default 'scale-down' profile which provides more
-  performance from the start for new pools (for newly created clusters).
-  Existing clusters will retain the old behavior, now called the 'scale-up' profile.
+* MGR: The pg_autoscaler has a new 'scale-down' profile which provides more
+  performance from the start for new pools. However, the module will remain
+  using it old behavior by default, now called the 'scale-up' profile.
   For more details, see:
 
   https://docs.ceph.com/en/latest/rados/operations/placement-groups/
index e05f41c971757821594fdd28fd52fcb71cfe97b6..c59830635cde9503300c653bdc83c5eddbce6adb 100644 (file)
@@ -126,24 +126,24 @@ example, a pool that maps to OSDs of class `ssd` and a pool that maps
 to OSDs of class `hdd` will each have optimal PG counts that depend on
 the number of those respective device types.
 
-The autoscaler uses the `scale-down` profile by default, 
-where each pool starts out with a full complements of PGs and only scales 
-down when the usage ratio across the pools is not even. However, it also has 
-a `scale-up` profile, where it starts out each pool with minimal PGs and scales
-up PGs when there is more usage in each pool.
+The autoscaler uses the `scale-up` profile by default,
+where it starts out each pool with minimal PGs and scales
+up PGs when there is more usage in each pool. However, it also has
+a `scale-down` profile, where each pool starts out with a full complements 
+of PGs and only scales down when the usage ratio across the pools is not even.
 
 With only the `scale-down` profile, the autoscaler identifies
 any overlapping roots and prevents the pools with such roots
 from scaling because overlapping roots can cause problems
 with the scaling process.
 
-To use the `scale-up` profile::
+To use the `scale-down` profile::
 
-  ceph osd pool set autoscale-profile scale-up
+  ceph osd pool set autoscale-profile scale-down
 
-To switch back to the default `scale-down` profile::
+To switch back to the default `scale-up` profile::
 
-  ceph osd pool set autoscale-profile scale-down
+  ceph osd pool set autoscale-profile scale-up
 
 Existing clusters will continue to use the `scale-up` profile.
 To use the `scale-down` profile, users will need to set autoscale-profile `scale-down`,
index 3d24b1a6c50c2444379dc600a389a49d3139111f..215b587078f0ca47c7662a9ea4ebd71fc012bb3e 100755 (executable)
@@ -45,6 +45,56 @@ ceph osd pool set b pg_autoscale_mode on
 # get num pools again since we created more pools
 NUM_POOLS=$(ceph osd pool ls | wc -l)
 
+# get profiles of pool a and b
+PROFILE1=$(ceph osd pool autoscale-status | grep 'a' | grep -o -m 1 'scale-up\|scale-down' || true)
+PROFILE2=$(ceph osd pool autoscale-status | grep 'b' | grep -o -m 1 'scale-up\|scale-down' || true)
+
+# evaluate the default profile a
+if [[ $PROFILE1 = "scale-up" ]]
+then
+  echo "Success: pool a PROFILE is scale-up"
+else
+  echo "Error: a PROFILE is scale-down"
+  exit 1
+fi
+
+# evaluate the default profile of pool b
+if [[ $PROFILE2 = "scale-up" ]]
+then
+  echo "Success: pool b PROFILE is scale-up"
+else
+  echo "Error: b PROFILE is scale-down"
+  exit 1
+fi
+
+# This part of this code will now evaluate the accuracy of
+# scale-down profile
+
+# change to scale-down profile
+ceph osd pool set autoscale-profile scale-down 
+
+# get profiles of pool a and b
+PROFILE1=$(ceph osd pool autoscale-status | grep 'a' | grep -o -m 1 'scale-up\|scale-down' || true)
+PROFILE2=$(ceph osd pool autoscale-status | grep 'b' | grep -o -m 1 'scale-up\|scale-down' || true)
+
+# evaluate that profile a is now scale-down
+if [[ $PROFILE1 = "scale-down" ]]
+then
+  echo "Success: pool a PROFILE is scale-down"
+else
+  echo "Error: a PROFILE is scale-up"
+  exit 1
+fi
+
+# evaluate the profile of b is now scale-down
+if [[ $PROFILE2 = "scale-down" ]]
+then
+  echo "Success: pool b PROFILE is scale-down"
+else
+  echo "Error: b PROFILE is scale-up"
+  exit 1
+fi
+
 # get pool size
 POOL_SIZE_A=$(ceph osd pool get a size| grep -Eo '[0-9]{1,4}')
 POOL_SIZE_B=$(ceph osd pool get b size| grep -Eo '[0-9]{1,4}')
index 157e9ebfef750b188b5abdd00c450c116f47cd04..a919a29eed20a1c22315e898ce3549dd1726ee07 100644 (file)
@@ -54,7 +54,7 @@ void KVMonitor::create_initial()
   version = 0;
   pending.clear();
   bufferlist bl;
-  bl.append("scale-down");
+  bl.append("scale-up");
   pending["config/mgr/mgr/pg_autoscaler/autoscale_profile"] = bl;
 }
 
index 8ce7acd3f79e69b8983a246bb6a5993c5781f259..487531bb6a9eea0dd5b5acb8db6150c892632cbe 100644 (file)
@@ -128,14 +128,14 @@ class PgAutoscaler(MgrModule):
             default=60),
         Option(
             'autoscale_profile',
-            default='scale-down',
+            default='scale-up',
             type='str',
             desc='pg_autoscale profiler',
             long_desc=('Determines the behavior of the autoscaler algorithm, '
-                       '`scale-down means start out with full pgs and scales'
-                       'down when there is pressure'
                        '`scale-up` means that it starts out with minmum pgs '
-                       'and scales up when there is pressure'),
+                       'and scales up when there is pressure'
+                       '`scale-down means start out with full pgs and scales'
+                       'down when there is pressure'),
             runtime=True),
         Option(
             name='threshold',
@@ -156,7 +156,7 @@ class PgAutoscaler(MgrModule):
         # to just keep a copy of the pythonized version.
         self._osd_map = None
         if TYPE_CHECKING:
-            self.autoscale_profile: 'ScaleModeT' = 'scale-down'
+            self.autoscale_profile: 'ScaleModeT' = 'scale-up'
             self.sleep_interval = 60
             self.mon_target_pg_per_osd = 0
             self.threshold = 3.0