From: Sage Weil Date: Thu, 30 May 2013 22:59:49 +0000 (-0700) Subject: mon/Paxos: adjust trimming defaults up; rename options X-Git-Tag: v0.64~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b8e74f0646a7e0d31db24eb29f3663fafed4ecc;p=ceph.git mon/Paxos: adjust trimming defaults up; rename options - trim more at a time (by an order of magnitude) - rename fields to paxos_trim_{min,max}; only trim when there are min items that are trimmable, and trim at most max items at a time. - adjust the paxos_service_trim_{min,max} values up by a factor of 2. Since we are compacting every time we trim, adjusting these up mean less frequent compactions and less overall work for the monitor. Signed-off-by: Sage Weil Reviewed-by: Greg Farnum --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 56a46aec0c0c..93f676b35d70 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -203,10 +203,11 @@ OPTION(paxos_stash_full_interval, OPT_INT, 25) // how often (in commits) to st OPTION(paxos_max_join_drift, OPT_INT, 10) // max paxos iterations before we must first sync the monitor stores OPTION(paxos_propose_interval, OPT_DOUBLE, 1.0) // gather updates for this long before proposing a map update OPTION(paxos_min_wait, OPT_DOUBLE, 0.05) // min time to gather updates for after period of inactivity -OPTION(paxos_trim_tolerance, OPT_INT, 30) // number of extra proposals tolerated before trimming +OPTION(paxos_trim_min, OPT_INT, 500) // number of extra proposals tolerated before trimming +OPTION(paxos_trim_max, OPT_INT, 1000) // max number of extra proposals to trim at a time OPTION(paxos_trim_disabled_max_versions, OPT_INT, 100) // maximum amount of versions we shall allow passing by without trimming -OPTION(paxos_service_trim_max, OPT_INT, 500) // maximum amount of versions to trim during a single proposal (0 disables it) -OPTION(paxos_service_trim_min, OPT_INT, 250) // minimum amount of versions to trigger a trim (0 disables it) +OPTION(paxos_service_trim_min, OPT_INT, 500) // minimum amount of versions to trigger a trim (0 disables it) +OPTION(paxos_service_trim_max, OPT_INT, 1000) // maximum amount of versions to trim during a single proposal (0 disables it) OPTION(clock_offset, OPT_DOUBLE, 0) // how much to offset the system clock in Clock.cc OPTION(auth_cluster_required, OPT_STR, "cephx") // required of mon, mds, osd daemons OPTION(auth_service_required, OPT_STR, "cephx") // required by daemons of clients diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index 160b02ecef25..be63889575e2 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -1154,7 +1154,8 @@ public: */ void trim() { assert(should_trim()); - version_t trim_to_version = get_version() - g_conf->paxos_max_join_drift; + version_t trim_to_version = MIN(get_version() - g_conf->paxos_max_join_drift, + get_first_committed() + g_conf->paxos_trim_max); trim_to(trim_to_version); } /** @@ -1188,7 +1189,7 @@ public: bool should_trim() { int available_versions = (get_version() - get_first_committed()); int maximum_versions = - (g_conf->paxos_max_join_drift + g_conf->paxos_trim_tolerance); + (g_conf->paxos_max_join_drift + g_conf->paxos_trim_min); if (going_to_trim || (available_versions <= maximum_versions)) return false;