-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gossip tuneables #4444
Gossip tuneables #4444
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,10 @@ func DefaultRPCProtocol() (int, error) { | |
// todo(fs): IMO, this should be the definitive default for all configurable values | ||
// todo(fs): and whatever is in here should clobber every default value. Hence, no sourcing. | ||
func DefaultSource() Source { | ||
cfg := consul.DefaultConfig() | ||
serfLAN := cfg.SerfLANConfig.MemberlistConfig | ||
serfWAN := cfg.SerfWANConfig.MemberlistConfig | ||
|
||
return Source{ | ||
Name: "default", | ||
Format: "hcl", | ||
|
@@ -62,6 +66,22 @@ func DefaultSource() Source { | |
max_trailing_logs = 250 | ||
server_stabilization_time = "10s" | ||
} | ||
gossip_lan = { | ||
gossip_interval = "` + serfLAN.GossipInterval.String() + `" | ||
gossip_nodes = ` + strconv.Itoa(serfLAN.GossipNodes) + ` | ||
retransmit_mult = ` + strconv.Itoa(serfLAN.RetransmitMult) + ` | ||
probe_interval = "` + serfLAN.ProbeInterval.String() + `" | ||
probe_timeout = "` + serfLAN.ProbeTimeout.String() + `" | ||
suspicion_mult = ` + strconv.Itoa(serfLAN.SuspicionMult) + ` | ||
} | ||
gossip_wan = { | ||
gossip_interval = "` + serfWAN.GossipInterval.String() + `" | ||
gossip_nodes = ` + strconv.Itoa(serfLAN.GossipNodes) + ` | ||
retransmit_mult = ` + strconv.Itoa(serfLAN.RetransmitMult) + ` | ||
probe_interval = "` + serfWAN.ProbeInterval.String() + `" | ||
probe_timeout = "` + serfWAN.ProbeTimeout.String() + `" | ||
suspicion_mult = ` + strconv.Itoa(serfWAN.SuspicionMult) + ` | ||
} | ||
dns_config = { | ||
allow_stale = true | ||
a_record_limit = 0 | ||
|
@@ -92,6 +112,7 @@ func DefaultSource() Source { | |
metrics_prefix = "consul" | ||
filter_default = true | ||
} | ||
|
||
`, | ||
} | ||
} | ||
|
@@ -111,6 +132,18 @@ func DevSource() Source { | |
log_level = "DEBUG" | ||
server = true | ||
|
||
gossip_lan = { | ||
gossip_interval = "100ms" | ||
probe_interval = "100ms" | ||
probe_timeout = "100ms" | ||
suspicion_mult = 3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See my other comment. We don't want to do that here. Only items specifically overridden for dev mode go here. |
||
} | ||
gossip_wan = { | ||
gossip_interval = "100ms" | ||
probe_interval = "100ms" | ||
probe_timeout = "100ms" | ||
suspicion_mult = 3 | ||
} | ||
connect = { | ||
enabled = true | ||
} | ||
|
@@ -166,8 +199,6 @@ func DefaultVersionSource() Source { | |
func DefaultConsulSource() Source { | ||
cfg := consul.DefaultConfig() | ||
raft := cfg.RaftConfig | ||
serfLAN := cfg.SerfLANConfig.MemberlistConfig | ||
serfWAN := cfg.SerfWANConfig.MemberlistConfig | ||
return Source{ | ||
Name: "consul", | ||
Format: "hcl", | ||
|
@@ -183,22 +214,6 @@ func DefaultConsulSource() Source { | |
heartbeat_timeout = "` + raft.HeartbeatTimeout.String() + `" | ||
leader_lease_timeout = "` + raft.LeaderLeaseTimeout.String() + `" | ||
} | ||
serf_lan = { | ||
memberlist = { | ||
gossip_interval = "` + serfLAN.GossipInterval.String() + `" | ||
probe_interval = "` + serfLAN.ProbeInterval.String() + `" | ||
probe_timeout = "` + serfLAN.ProbeTimeout.String() + `" | ||
suspicion_mult = ` + strconv.Itoa(serfLAN.SuspicionMult) + ` | ||
} | ||
} | ||
serf_wan = { | ||
memberlist = { | ||
gossip_interval = "` + serfWAN.GossipInterval.String() + `" | ||
probe_interval = "` + serfWAN.ProbeInterval.String() + `" | ||
probe_timeout = "` + serfWAN.ProbeTimeout.String() + `" | ||
suspicion_mult = ` + strconv.Itoa(serfWAN.SuspicionMult) + ` | ||
} | ||
} | ||
server = { | ||
health_interval = "` + cfg.ServerHealthInterval.String() + `" | ||
} | ||
|
@@ -223,22 +238,6 @@ func DevConsulSource() Source { | |
heartbeat_timeout = "35ms" | ||
leader_lease_timeout = "20ms" | ||
} | ||
serf_lan = { | ||
memberlist = { | ||
gossip_interval = "100ms" | ||
probe_interval = "100ms" | ||
probe_timeout = "100ms" | ||
suspicion_mult = 3 | ||
} | ||
} | ||
serf_wan = { | ||
memberlist = { | ||
gossip_interval = "100ms" | ||
probe_interval = "100ms" | ||
probe_timeout = "100ms" | ||
suspicion_mult = 3 | ||
} | ||
} | ||
server = { | ||
health_interval = "10ms" | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the significance of these moving from
DefaultConsulSource
to here? This seems like a better place but I don't recall offhand the details of how these two methods interact...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In depth explanation in my other comment.
DefaultConsulSource = non user modifiable
DefaultSource = user modifiable