From fde536fa5d2d87ee438f229b264e4b0c1b0642d5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 7 Jun 2013 15:16:42 -0700 Subject: [PATCH] osd: make scrub chunk size tunable It was hard-coded at 5. Make it range from 5-15 by default, for now. We should still keep this smallish since this range is locked for the duration of the scrub on this chunk. Signed-off-by: Sage Weil --- src/common/config_opts.h | 2 ++ src/osd/PG.cc | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index a6b380b0b409b..b6b9e17fde988 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -426,6 +426,8 @@ OPTION(osd_max_scrubs, OPT_INT, 1) OPTION(osd_scrub_load_threshold, OPT_FLOAT, 0.5) OPTION(osd_scrub_min_interval, OPT_FLOAT, 60*60*24) // if load is low OPTION(osd_scrub_max_interval, OPT_FLOAT, 7*60*60*24) // regardless of load +OPTION(osd_scrub_chunk_min, OPT_INT, 5) +OPTION(osd_scrub_chunk_max, OPT_INT, 25) OPTION(osd_deep_scrub_interval, OPT_FLOAT, 60*60*24*7) // once a week OPTION(osd_deep_scrub_stride, OPT_INT, 524288) OPTION(osd_scan_list_ping_tp_interval, OPT_U64, 100) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 929f37ab9815a..24f7430d16885 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3658,7 +3658,9 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle) while (!boundary_found) { vector objects; ret = osd->store->collection_list_partial(coll, start, - 5, 5, 0, + g_conf->osd_scrub_chunk_min, + g_conf->osd_scrub_chunk_max, + 0, &objects, &scrubber.end); assert(ret >= 0); -- 2.39.5