]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: make gc concurrenct io size configurable
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 22 Feb 2018 22:28:29 +0000 (14:28 -0800)
committerJesse Williamson <nerd.cpp@gmail.com>
Thu, 11 Jul 2019 17:32:58 +0000 (10:32 -0700)
and another tunable for log trim size

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 1cceef22cf26e1a4a0234fb2f977a5fefae82905)

src/common/legacy_config_opts.h
src/common/options.cc
src/rgw/rgw_gc.cc

index 3fb2440ea148f8dc5b92b3eab14a8bd2a92c7763..c23f7128a05aaeac5d689534fd199fe5f5d3925b 100644 (file)
@@ -1467,6 +1467,8 @@ OPTION(rgw_gc_max_objs, OPT_INT)
 OPTION(rgw_gc_obj_min_wait, OPT_INT)    // wait time before object may be handled by gc
 OPTION(rgw_gc_processor_max_time, OPT_INT)  // total run time for a single gc processor work
 OPTION(rgw_gc_processor_period, OPT_INT)  // gc processor cycle time
+OPTION(rgw_gc_max_concurrent_io, OPT_INT)  // gc processor cycle time
+OPTION(rgw_gc_max_trim_chunk, OPT_INT)  // gc trim chunk size
 OPTION(rgw_s3_success_create_obj_status, OPT_INT) // alternative success status response for create-obj (0 - default)
 OPTION(rgw_resolve_cname, OPT_BOOL)  // should rgw try to resolve hostname as a dns cname record
 OPTION(rgw_obj_stripe_size, OPT_INT)
index 8d24234ed919bbaaa8157c60332fc58710e6c45a..614ea6c30fd6f6e3ccb819b4e9977078ccd6336a 100644 (file)
@@ -5181,7 +5181,7 @@ std::vector<Option> get_rgw_options() {
     .set_long_description(
         "The number of garbage collector data shards, is the number of RADOS objects that "
         "RGW will use to store the garbage collection information on.")
-    .add_see_also({"rgw_gc_obj_min_wait", "rgw_gc_processor_max_time", "rgw_gc_processor_period"}),
+    .add_see_also({"rgw_gc_obj_min_wait", "rgw_gc_processor_max_time", "rgw_gc_processor_period", "rgw_gc_max_concurrent_io"}),
 
     Option("rgw_gc_obj_min_wait", Option::TYPE_INT, Option::LEVEL_ADVANCED)
     .set_default(2_hr)
@@ -5191,7 +5191,7 @@ std::vector<Option> get_rgw_options() {
        "a deleted object's data. RGW will not remove object immediately, as object could "
        "still have readers. A mechanism exists to increase the object's expiration time "
        "when it's being read.")
-    .add_see_also({"rgw_gc_max_objs", "rgw_gc_processor_max_time", "rgw_gc_processor_period"}),
+    .add_see_also({"rgw_gc_max_objs", "rgw_gc_processor_max_time", "rgw_gc_processor_period", "rgw_gc_max_concurrent_io"}),
 
     Option("rgw_gc_processor_max_time", Option::TYPE_INT, Option::LEVEL_ADVANCED)
     .set_default(1_hr)
@@ -5203,7 +5203,7 @@ std::vector<Option> get_rgw_options() {
         "objects concurrently. This time signifies that maximum amount of time that RGW "
         "is allowed to hold that lease. In the case where RGW goes down uncleanly, this "
         "is the amount of time where processing of that data shard will be blocked.")
-    .add_see_also({"rgw_gc_max_objs", "rgw_gc_obj_min_wait", "rgw_gc_processor_period"}),
+    .add_see_also({"rgw_gc_max_objs", "rgw_gc_obj_min_wait", "rgw_gc_processor_period", "rgw_gc_max_concurrent_io"}),
 
     Option("rgw_gc_processor_period", Option::TYPE_INT, Option::LEVEL_ADVANCED)
     .set_default(1_hr)
@@ -5212,7 +5212,20 @@ std::vector<Option> get_rgw_options() {
         "The amount of time between the start of consecutive runs of the garbage collector "
         "threads. If garbage collector runs takes more than this period, it will not wait "
         "before running again.")
-    .add_see_also({"rgw_gc_max_objs", "rgw_gc_obj_min_wait", "rgw_gc_processor_max_time"}),
+    .add_see_also({"rgw_gc_max_objs", "rgw_gc_obj_min_wait", "rgw_gc_processor_max_time", "rgw_gc_max_concurrent_io", "rgw_gc_max_trim_chunk"}),
+
+    Option("rgw_gc_max_concurrent_io", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    .set_default(10)
+    .set_description("Max concurrent RADOS IO operations for garbage collection")
+    .set_long_description(
+        "The maximum number of concurrent IO operations that the RGW garbage collection "
+        "thread will use when purging old data.")
+    .add_see_also({"rgw_gc_max_objs", "rgw_gc_obj_min_wait", "rgw_gc_processor_max_time", "rgw_gc_max_trim_chunk"}),
+
+    Option("rgw_gc_max_trim_chunk", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    .set_default(16)
+    .set_description("Max number of keys to remove from garbage collector log in a single operation")
+    .add_see_also({"rgw_gc_max_objs", "rgw_gc_obj_min_wait", "rgw_gc_processor_max_time", "rgw_gc_max_concurrent_io"}),
 
     Option("rgw_s3_success_create_obj_status", Option::TYPE_INT, Option::LEVEL_ADVANCED)
     .set_default(0)
index 252254698a03e6390dc94b6614acaf4d942cc19b..038ee274597f0691ad64e7a5d96b1454d33608a9 100644 (file)
@@ -154,9 +154,14 @@ class RGWGCIOManager {
   list<IO> ios;
   map<int, std::list<string> > remove_tags;
 
+#define MAX_AIO_DEFAULT 10
+  size_t max_aio{MAX_AIO_DEFAULT};
+
 public:
   RGWGCIOManager(CephContext *_cct, RGWGC *_gc) : cct(_cct),
-                                                  gc(_gc) {}
+                                                  gc(_gc) {
+    max_aio = cct->_conf->rgw_gc_max_concurrent_io;
+  }
   ~RGWGCIOManager() {
     for (auto io : ios) {
       io.c->release();
@@ -164,9 +169,7 @@ public:
   }
 
   int schedule_io(IoCtx *ioctx, const string& oid, ObjectWriteOperation *op, int index, const string& tag) {
-#warning configurable
-#define MAX_CONCURRENT_IO 5
-    while (ios.size() > MAX_CONCURRENT_IO) {
+    while (ios.size() > max_aio) {
       if (gc->going_down()) {
         return 0;
       }
@@ -209,8 +212,7 @@ public:
     }
 
     rt.push_back(io.tag);
-#define MAX_REMOVE_CHUNK 16
-    if (rt.size() > MAX_REMOVE_CHUNK) {
+    if (rt.size() > (size_t)cct->_conf->rgw_gc_max_trim_chunk) {
       flush_remove_tags(io.index, rt);
     }
 done: