pub struct MemberlistOptions {Show 19 fields
pub timeout: Duration,
pub indirect_checks: usize,
pub retransmit_mult: usize,
pub suspicion_mult: usize,
pub suspicion_max_timeout_mult: usize,
pub push_pull_interval: Duration,
pub probe_interval: Duration,
pub probe_timeout: Duration,
pub disable_promised_pings: bool,
pub awareness_max_multiplier: usize,
pub gossip_interval: Duration,
pub gossip_nodes: usize,
pub gossip_to_the_dead_time: Duration,
pub protocol_version: ProtocolVersion,
pub delegate_version: DelegateVersion,
pub handoff_queue_depth: usize,
pub dead_node_reclaim_time: Duration,
pub queue_check_interval: Duration,
pub metric_labels: Arc<MetricLabels>,
}Expand description
Options used to configure the memberlist.
Fields§
§timeout: DurationThe timeout for establishing a stream connection with a remote node for a full state sync, and for stream read and write operations.
indirect_checks: usizeThe number of nodes that will be asked to perform
an indirect probe of a node in the case a direct probe fails. Memberlist
waits for an ack from any single indirect node, so increasing this
number will increase the likelihood that an indirect probe will succeed
at the expense of bandwidth.
retransmit_mult: usizeThe multiplier for the number of retransmissions that are attempted for messages broadcasted over gossip. The actual count of retransmissions is calculated using the formula:
retransmits = retransmit_mult * log(N+1)
This allows the retransmits to scale properly with cluster size. The higher the multiplier, the more likely a failed broadcast is to converge at the expense of increased bandwidth.
suspicion_mult: usizeThe multiplier for determining the time an inaccessible node is considered suspect before declaring it dead. The actual timeout is calculated using the formula:
suspicion_timeout = suspicion_mult * log(N+1) * probe_interval
This allows the timeout to scale properly with expected propagation delay with a larger cluster size. The higher the multiplier, the longer an inaccessible node is considered part of the cluster before declaring it dead, giving that suspect node more time to refute if it is indeed still alive.
suspicion_max_timeout_mult: usizeThe multiplier applied to the
suspicion_timeout used as an upper bound on detection time. This max
timeout is calculated using the formula:
suspicion_max_timeout = suspicion_max_timeout_mult * suspicion_timeout
If everything is working properly, confirmations from other nodes will accelerate suspicion timers in a manner which will cause the timeout to reach the base SuspicionTimeout before that elapses, so this value will typically only come into play if a node is experiencing issues communicating with other nodes. It should be set to a something fairly large so that a node having problems will have a lot of chances to recover before falsely declaring other nodes as failed, but short enough for a legitimately isolated node to still make progress marking nodes failed in a reasonable amount of time.
push_pull_interval: DurationThe interval between complete state syncs. Complete state syncs are done with a single node over TCP and are quite expensive relative to standard gossiped messages. Setting this to zero will disable state push/pull syncs completely.
Setting this interval lower (more frequent) will increase convergence speeds across larger clusters at the expense of increased bandwidth usage.
probe_interval: DurationThe interval between random node probes. Setting this lower (more frequent) will cause the memberlist cluster to detect failed nodes more quickly at the expense of increased bandwidth usage
probe_timeout: DurationThe timeout to wait for an ack from a probed node before assuming it is unhealthy. This should be set to 99-percentile of RTT (round-trip time) on your network.
disable_promised_pings: boolSet this field will turn off the fallback promised pings that are attempted if the direct unreliable ping fails. These get pipelined along with the indirect unreliable pings.
awareness_max_multiplier: usizeIncrease the probe interval if the node becomes aware that it might be degraded and not meeting the soft real time requirements to reliably probe other nodes.
gossip_interval: DurationThe interval between sending messages that need to be gossiped that haven’t been able to piggyback on probing messages. If this is set to zero, non-piggyback gossip is disabled. By lowering this value (more frequent) gossip messages are propagated across the cluster more quickly at the expense of increased bandwidth.
gossip_nodes: usizeThe number of random nodes to send gossip messages to
per gossip_interval. Increasing this number causes the gossip messages
to propagate across the cluster more quickly at the expense of
increased bandwidth.
gossip_to_the_dead_time: DurationThe interval after which a node has died that we will still try to gossip to it. This gives it a chance to refute.
protocol_version: ProtocolVersionUsed to guarantee protocol-compatibility
delegate_version: DelegateVersionUsed to guarantee protocol-compatibility for any custom messages that the delegate might do (broadcasts, local/remote state, etc.). If you don’t set these, then the protocol versions will just be zero, and version compliance won’t be done.
handoff_queue_depth: usizeSize of Memberlist’s internal channel which handles UDP messages. The size of this determines the size of the queue which Memberlist will keep while UDP messages are handled.
dead_node_reclaim_time: DurationControls the time before a dead node’s name can be reclaimed by one with a different address or port. By default, this is 0, meaning nodes cannot be reclaimed this way.
queue_check_interval: DurationThe interval at which we check the message queue to apply the warning and max depth.
metric_labels: Arc<MetricLabels>The metric labels for the memberlist.
Implementations§
Source§impl Options
impl Options
Sourcepub const fn timeout(&self) -> Duration
pub const fn timeout(&self) -> Duration
Returns the timeout for establishing a stream connection with a remote node for a full state sync, and for stream read and write operations.
Sourcepub const fn indirect_checks(&self) -> usize
pub const fn indirect_checks(&self) -> usize
Returns the number of nodes that will be asked to perform an indirect probe of a node in the case a direct probe fails.
Sourcepub const fn retransmit_mult(&self) -> usize
pub const fn retransmit_mult(&self) -> usize
Returns the retransmit mult
Sourcepub const fn suspicion_mult(&self) -> usize
pub const fn suspicion_mult(&self) -> usize
Returns the suspicion mult
Sourcepub const fn suspicion_max_timeout_mult(&self) -> usize
pub const fn suspicion_max_timeout_mult(&self) -> usize
Returns the suspicion max timeout mult
Sourcepub const fn push_pull_interval(&self) -> Duration
pub const fn push_pull_interval(&self) -> Duration
Returns the push pull interval
Sourcepub const fn probe_interval(&self) -> Duration
pub const fn probe_interval(&self) -> Duration
Returns the probe interval
Sourcepub const fn probe_timeout(&self) -> Duration
pub const fn probe_timeout(&self) -> Duration
Returns the probe timeout
Sourcepub const fn disable_promised_pings(&self) -> bool
pub const fn disable_promised_pings(&self) -> bool
Returns whether disable promised pings or not
Sourcepub const fn awareness_max_multiplier(&self) -> usize
pub const fn awareness_max_multiplier(&self) -> usize
Returns the awareness max multiplier
Sourcepub const fn gossip_interval(&self) -> Duration
pub const fn gossip_interval(&self) -> Duration
Returns the gossip interval
Sourcepub const fn gossip_nodes(&self) -> usize
pub const fn gossip_nodes(&self) -> usize
Returns the gossip nodes
Sourcepub const fn gossip_to_the_dead_time(&self) -> Duration
pub const fn gossip_to_the_dead_time(&self) -> Duration
Returns the gossip to the dead timeout
Sourcepub const fn protocol_version(&self) -> ProtocolVersion
pub const fn protocol_version(&self) -> ProtocolVersion
Returns the protocol version this node is speaking
Sourcepub const fn delegate_version(&self) -> DelegateVersion
pub const fn delegate_version(&self) -> DelegateVersion
Returns the delegate version this node is speaking
Sourcepub const fn handoff_queue_depth(&self) -> usize
pub const fn handoff_queue_depth(&self) -> usize
Returns the handoff queue depth
Sourcepub const fn dead_node_reclaim_time(&self) -> Duration
pub const fn dead_node_reclaim_time(&self) -> Duration
Returns the dead node reclaim time
Sourcepub const fn queue_check_interval(&self) -> Duration
pub const fn queue_check_interval(&self) -> Duration
Returns the queue check interval
Sourcepub const fn metric_labels(&self) -> &Arc<MetricLabels>
pub const fn metric_labels(&self) -> &Arc<MetricLabels>
Get the metric labels for the memberlist.
Sourcepub const fn with_timeout(self, val: Duration) -> Options
pub const fn with_timeout(self, val: Duration) -> Options
Sets the timeout for establishing a stream connection with a remote node for a full state sync, and for stream read and write operations (Builder pattern).
Sourcepub const fn with_indirect_checks(self, val: usize) -> Options
pub const fn with_indirect_checks(self, val: usize) -> Options
Sets the number of nodes that will be asked to perform an indirect probe of a node in the case a direct probe fails (Builder pattern).
Sourcepub const fn with_retransmit_mult(self, val: usize) -> Options
pub const fn with_retransmit_mult(self, val: usize) -> Options
Sets the retransmit mult (Builder pattern).
Sourcepub const fn with_suspicion_mult(self, val: usize) -> Options
pub const fn with_suspicion_mult(self, val: usize) -> Options
Sets the suspicion mult (Builder pattern).
Sourcepub const fn with_suspicion_max_timeout_mult(self, val: usize) -> Options
pub const fn with_suspicion_max_timeout_mult(self, val: usize) -> Options
Sets the suspicion max timeout mult (Builder pattern).
Sourcepub const fn with_push_pull_interval(self, val: Duration) -> Options
pub const fn with_push_pull_interval(self, val: Duration) -> Options
Sets the push pull interval (Builder pattern).
Sourcepub const fn with_probe_interval(self, val: Duration) -> Options
pub const fn with_probe_interval(self, val: Duration) -> Options
Sets the probe interval (Builder pattern).
Sourcepub const fn with_probe_timeout(self, val: Duration) -> Options
pub const fn with_probe_timeout(self, val: Duration) -> Options
Sets the probe timeout (Builder pattern).
Sourcepub const fn with_disable_promised_pings(self, val: bool) -> Options
pub const fn with_disable_promised_pings(self, val: bool) -> Options
Sets whether disable promised pings or not (Builder pattern).
Sourcepub const fn with_awareness_max_multiplier(self, val: usize) -> Options
pub const fn with_awareness_max_multiplier(self, val: usize) -> Options
Sets the awareness max multiplier (Builder pattern).
Sourcepub const fn with_gossip_interval(self, val: Duration) -> Options
pub const fn with_gossip_interval(self, val: Duration) -> Options
Sets the gossip interval (Builder pattern).
Sourcepub const fn with_gossip_nodes(self, val: usize) -> Options
pub const fn with_gossip_nodes(self, val: usize) -> Options
Sets the gossip nodes (Builder pattern).
Sourcepub const fn with_gossip_to_the_dead_time(self, val: Duration) -> Options
pub const fn with_gossip_to_the_dead_time(self, val: Duration) -> Options
Sets the gossip to the dead timeout (Builder pattern).
Sourcepub const fn with_protocol_version(self, val: ProtocolVersion) -> Options
pub const fn with_protocol_version(self, val: ProtocolVersion) -> Options
Sets the protocol version this node is speaking (Builder pattern).
Sourcepub const fn with_delegate_version(self, val: DelegateVersion) -> Options
pub const fn with_delegate_version(self, val: DelegateVersion) -> Options
Sets the delegate version this node is speaking (Builder pattern).
Sourcepub const fn with_handoff_queue_depth(self, val: usize) -> Options
pub const fn with_handoff_queue_depth(self, val: usize) -> Options
Sets the handoff queue depth (Builder pattern).
Sourcepub const fn with_dead_node_reclaim_time(self, val: Duration) -> Options
pub const fn with_dead_node_reclaim_time(self, val: Duration) -> Options
Sets the dead node reclaim time (Builder pattern).
Sourcepub const fn with_queue_check_interval(self, val: Duration) -> Options
pub const fn with_queue_check_interval(self, val: Duration) -> Options
Sets the queue check interval (Builder pattern).
Sourcepub fn with_metric_labels(self, val: Arc<MetricLabels>) -> Options
pub fn with_metric_labels(self, val: Arc<MetricLabels>) -> Options
Sets the metric labels for the memberlist.
Source§impl Options
impl Options
Sourcepub fn lan() -> Options
pub fn lan() -> Options
Returns a sane set of configurations for Memberlist. Sets very conservative values that are sane for most LAN environments. The default configuration errs on the side of caution, choosing values that are optimized for higher convergence at the cost of higher bandwidth usage. Regardless, these values are a good starting point when getting started with memberlist.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Options
impl<'de> Deserialize<'de> for Options
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Options, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Options, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Options
impl Serialize for Options
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.