From 7f646898285f487ea24e3d5b45da6c172061dc08 Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Fri, 28 Apr 2017 12:10:57 -0700 Subject: [PATCH] Faster dev server startup This patch reduces the timeouts for the development server so that it starts up almost instantly. --- command/agent/config.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/command/agent/config.go b/command/agent/config.go index 9803858c3..19e4f8db8 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -864,6 +864,23 @@ func DevConfig() *Config { conf.DisableAnonymousSignature = true conf.EnableUI = true conf.BindAddr = "127.0.0.1" + + conf.ConsulConfig = consul.DefaultConfig() + conf.ConsulConfig.SerfLANConfig.MemberlistConfig.ProbeTimeout = 100 * time.Millisecond + conf.ConsulConfig.SerfLANConfig.MemberlistConfig.ProbeInterval = 100 * time.Millisecond + conf.ConsulConfig.SerfLANConfig.MemberlistConfig.GossipInterval = 100 * time.Millisecond + + conf.ConsulConfig.SerfWANConfig.MemberlistConfig.SuspicionMult = 3 + conf.ConsulConfig.SerfWANConfig.MemberlistConfig.ProbeTimeout = 100 * time.Millisecond + conf.ConsulConfig.SerfWANConfig.MemberlistConfig.ProbeInterval = 100 * time.Millisecond + conf.ConsulConfig.SerfWANConfig.MemberlistConfig.GossipInterval = 100 * time.Millisecond + + conf.ConsulConfig.RaftConfig.LeaderLeaseTimeout = 20 * time.Millisecond + conf.ConsulConfig.RaftConfig.HeartbeatTimeout = 40 * time.Millisecond + conf.ConsulConfig.RaftConfig.ElectionTimeout = 40 * time.Millisecond + + conf.ConsulConfig.CoordinateUpdatePeriod = 100 * time.Millisecond + return conf }