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)
.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)
"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)
"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)
"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)
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();
}
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;
}
}
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: