From 5065f3d82efca167136ff250450d819e8416911a Mon Sep 17 00:00:00 2001 From: James Phillips Date: Thu, 7 Dec 2017 16:27:06 -0800 Subject: [PATCH] Turns of intent queue warnings and enables dynamic queue sizing. --- agent/consul/config.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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,