Faster dev server startup

This patch reduces the timeouts for the development
server so that it starts up almost instantly.
This commit is contained in:
Frank Schroeder 2017-04-28 12:10:57 -07:00 committed by Frank Schröder
parent 4130d73e60
commit 7f64689828
1 changed files with 17 additions and 0 deletions

View File

@ -864,6 +864,23 @@ func DevConfig() *Config {
conf.DisableAnonymousSignature = true conf.DisableAnonymousSignature = true
conf.EnableUI = true conf.EnableUI = true
conf.BindAddr = "127.0.0.1" 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 return conf
} }