]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: decay tier agent histograms over time
authorSage Weil <sage@inktank.com>
Fri, 24 Jan 2014 22:57:02 +0000 (14:57 -0800)
committerSage Weil <sage@inktank.com>
Sun, 16 Feb 2014 06:09:38 +0000 (22:09 -0800)
Make decisions based on recent observations of object age distributions,
not all time history.

Signed-off-by: Sage Weil <sage@inktank.com>
src/common/config_opts.h
src/osd/ReplicatedPG.cc
src/osd/TierAgentState.h

index cca1881f100835ee3951c793647ee50282250269..7f7dd2ef70cf180badab8073064a9f26cde8361f 100644 (file)
@@ -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")
index b43f2a9915e268ff30651b6e8c12aba02c7753a3..e2f6bec322554bc88633f3d0f2def316941d3e49 100644 (file)
@@ -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
index 615633847b80f8af113152c3e6ce9f1f8b30cf7e..5cb12c7e66faee7d34c2f20ddff8a27f8f2c0ad2 100644 (file)
@@ -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<time_t,HitSetRef> 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)
   {}