diff options
author | Sage Weil <sage@inktank.com> | 2013-05-30 15:59:49 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-02 16:34:17 -0700 |
commit | 61135964419ecf5165366724d064b623b517fb4e (patch) | |
tree | 57d8a590d82c454661fe58ad77ebbf0c042b52ef | |
parent | 2dc402815f71204cfe592cfb3d6758486d84166d (diff) | |
download | ceph-61135964419ecf5165366724d064b623b517fb4e.tar.gz |
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 <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit 6b8e74f0646a7e0d31db24eb29f3663fafed4ecc)
-rw-r--r-- | src/common/config_opts.h | 7 | ||||
-rw-r--r-- | src/mon/Paxos.h | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h index ef00babe68a..d7684a4ba29 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -200,10 +200,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 160b02ecef2..be63889575e 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; |