From 0db140c15c16ce45de2e59f075de2b70c0a9cd95 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 16 Jan 2020 11:22:34 -0600 Subject: [PATCH] osd: trim pg logs based on a per-osd budget Set the default budget based on the current defaults: 3000 per osd, and a rule of thumb target of 100 PGs per OSD. Set the per-PG trim target by dividing the overall value by the number of PGs on the OSD. Increase the max pg log length alone, so if the OSD has <100 PGs, those PGs will get more entries. Reduce the minimum to be smaller than the max. Use the min/max config options to bracket what is allocated to a single PG. Signed-off-by: Sage Weil --- src/common/legacy_config_opts.h | 1 + src/common/options.cc | 10 ++++++++-- src/crimson/osd/pg.cc | 24 ++++++++++++++++++++++++ src/crimson/osd/pg.h | 2 ++ src/osd/OSD.cc | 20 ++++++++++++++++++++ src/osd/OSD.h | 3 +++ src/osd/PG.cc | 5 +++++ src/osd/PG.h | 1 + src/osd/PeeringState.cc | 4 ++-- src/osd/PeeringState.h | 2 ++ 10 files changed, 68 insertions(+), 4 deletions(-) diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 875f64dc92a..7aff6bedcad 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -721,6 +721,7 @@ OPTION(osd_kill_backfill_at, OPT_INT) // Bounds how infrequently a new map epoch will be persisted for a pg OPTION(osd_pg_epoch_persisted_max_stale, OPT_U32) // make this < map_cache_size! +OPTION(osd_target_pg_log_entries_per_osd, OPT_U32) OPTION(osd_min_pg_log_entries, OPT_U32) // number of entries to keep in the pg log when trimming it OPTION(osd_max_pg_log_entries, OPT_U32) // max entries, say when degraded, before we trim OPTION(osd_pg_log_dups_tracked, OPT_U32) // how many versions back to track combined in both pglog's regular + dup logs diff --git a/src/common/options.cc b/src/common/options.cc index 51d5d48080f..1810dea7370 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -3302,15 +3302,21 @@ std::vector