From 48a4d2ccba6e4ed2c0eb69eaf96a3ba3fd4fdf7f Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Sun, 6 Sep 2015 00:38:03 -0700 Subject: [PATCH] Documentation/tuning: cleanup paragraph on max election - Use one sentence per line for easier diffing - Walkthrough the thought process and cleanup the grammar - Move below the other sections Original author: @philips --- Documentation/tuning.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation/tuning.md b/Documentation/tuning.md index 1aa6d5b87..c04ff3282 100644 --- a/Documentation/tuning.md +++ b/Documentation/tuning.md @@ -27,11 +27,14 @@ The election timeout should be set based on the heartbeat interval and average r Election timeouts must be at least 10 times the round-trip time so it can account for variance in your network. For example, if the round-trip time between your members is 10ms then you should have at least a 100ms election timeout. -The upper limit of election timeout is 50000ms, which should only be used when deploying global etcd cluster. First, 5s is the upper limit of average global round-trip time. A reasonable round-trip time for the continental united states is 130ms, and the time between US and japan is around 350-400ms. Because package gets delayed a lot, and network situation may be terrible, 5s is a safe value for it. Then, because election timeout should be an order of magnitude bigger than broadcast time, 50s becomes its maximum. - You should also set your election timeout to at least 5 to 10 times your heartbeat interval to account for variance in leader replication. For a heartbeat interval of 50ms you should set your election timeout to at least 250ms - 500ms. +The upper limit of election timeout is 50000ms (50s), which should only be used when deploying a globally-distributed etcd cluster. +A reasonable round-trip time for the continental United States is 130ms, and the time between US and Japan is around 350-400ms. +If your network has uneven performance or regular packet delays/loss then it is possible that a couple of retries may be necessary to successfully send a packet. So 5s is a safe upper limit of global round-trip time. +As the election timeout should be an order of magnitude bigger than broadcast time, in the case of ~5s for a globally distributed cluster, then 50 seconds becomes a reasonable maximum. + The heartbeat interval and election timeout value should be the same for all members in one cluster. Setting different values for etcd members may disrupt cluster stability. You can override the default values on the command line: