From: Sage Weil Date: Fri, 24 Jan 2014 22:57:02 +0000 (-0800) Subject: osd/ReplicatedPG: decay tier agent histograms over time X-Git-Tag: v0.78~166^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=18bc151becf4398c647d071c469bc8f0b24af31d;p=ceph.git osd/ReplicatedPG: decay tier agent histograms over time Make decisions based on recent observations of object age distributions, not all time history. Signed-off-by: Sage Weil --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index cca1881f1008..7f7dd2ef70cf 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -390,6 +390,9 @@ OPTION(osd_backfill_retry_interval, OPT_DOUBLE, 10.0) OPTION(osd_agent_max_ops, OPT_INT, 4) OPTION(osd_agent_min_evict_effort, OPT_FLOAT, .05) +// decay atime and hist histograms after how many objects go by +OPTION(osd_agent_hist_halflife, OPT_INT, 1000) + OPTION(osd_uuid, OPT_UUID, uuid_d()) OPTION(osd_data, OPT_STR, "/var/lib/ceph/osd/$cluster-$id") OPTION(osd_journal, OPT_STR, "/var/lib/ceph/osd/$cluster-$id/journal") diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index b43f2a9915e2..e2f6bec32255 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -10264,6 +10264,13 @@ void ReplicatedPG::agent_work(int start_max) break; } + if (++agent_state->hist_age > g_conf->osd_agent_hist_halflife) { + dout(20) << __func__ << " resetting atime and temp histograms" << dendl; + agent_state->hist_age = 0; + agent_state->atime_hist.decay(); + agent_state->temp_hist.decay(); + } + if (next.is_max()) agent_state->position = hobject_t(); else diff --git a/src/osd/TierAgentState.h b/src/osd/TierAgentState.h index 615633847b80..5cb12c7e66fa 100644 --- a/src/osd/TierAgentState.h +++ b/src/osd/TierAgentState.h @@ -21,6 +21,7 @@ struct TierAgentState { /// histogram of ages we've encountered pow2_hist_t atime_hist; pow2_hist_t temp_hist; + int hist_age; /// past HitSet(s) (not current) map hit_set_map; @@ -65,7 +66,8 @@ struct TierAgentState { unsigned evict_effort; TierAgentState() - : flush_mode(FLUSH_MODE_IDLE), + : hist_age(0), + flush_mode(FLUSH_MODE_IDLE), evict_mode(EVICT_MODE_IDLE), evict_effort(0) {}