diff --git a/agent/consul/config.go b/agent/consul/config.go index c37dd8d67d..d0b26d93b6 100644 --- a/agent/consul/config.go +++ b/agent/consul/config.go @@ -376,6 +376,21 @@ func (c *Config) CheckACL() error { return nil } +// SerfDefaultConfig returns a Consul-flavored Serf default configuration, +// suitable as a basis for a LAN, WAN, segment, or area. +func SerfDefaultConfig() *serf.Config { + base := serf.DefaultConfig() + + // This effectively disables the annoying queue depth warnings. + base.QueueDepthWarning = 1000000 + + // This enables dynamic sizing of the message queue depth based on the + // cluster size. + base.MinQueueDepth = 4096 + + return base +} + // DefaultConfig returns a sane default configuration. func DefaultConfig() *Config { hostname, err := os.Hostname() @@ -389,8 +404,8 @@ func DefaultConfig() *Config { NodeName: hostname, RPCAddr: DefaultRPCAddr, RaftConfig: raft.DefaultConfig(), - SerfLANConfig: serf.DefaultConfig(), - SerfWANConfig: serf.DefaultConfig(), + SerfLANConfig: SerfDefaultConfig(), + SerfWANConfig: SerfDefaultConfig(), SerfFloodInterval: 60 * time.Second, ReconcileInterval: 60 * time.Second, ProtocolVersion: ProtocolVersion2Compatible,