]> 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)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 23 Feb 2018 16:42:52 +0000 (08:42 -0800)
and another tunable for log trim size

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/common/legacy_config_opts.h
src/common/options.cc
src/rgw/rgw_gc.cc

index 298721ef83bdec318dfcd9bcf3f5ccdd157525c7..8448567efb9940c01fd287ba467b8ffd24849444 100644 (file)
@@ -1409,6 +1409,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 628fc57269f6b1aca5ae8695fddae567683cfa26..27d5ee188ba2d26abc67b8d6e9a79a62d1598b8c 100644 (file)
@@ -5235,7 +5235,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)
@@ -5245,7 +5245,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)
@@ -5257,7 +5257,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)
@@ -5266,7 +5266,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 6cccf62e7586befa06a1a25a8f4e4eeb51ab71d7..77fc70949b9c77d6dacd1b90ff3353ab37602b29 100644 (file)
@@ -146,9 +146,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();
@@ -156,9 +161,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;
       }
@@ -201,8 +204,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: