github.com/grafana/pyroscope@v1.18.0/docs/sources/reference-pyroscope-architecture/memberlist-and-the-gossip-protocol.md (about) 1 --- 2 title: "Pyroscope memberlist and gossip protocol" 3 menuTitle: "Memberlist and gossip protocol" 4 description: "Memberlist manages Pyroscope cluster membership and node detection failure." 5 weight: 80 6 --- 7 8 # Pyroscope memberlist and gossip protocol 9 10 [Memberlist](https://github.com/hashicorp/memberlist) is a Go library that manages cluster membership, node failure detection, and message passing using a gossip-based protocol. 11 Memberlist is eventually consistent and network partitions are partially tolerated by attempting to communicate to potentially dead nodes through multiple routes. 12 13 Pyroscope uses memberlist to implement the [hash ring](../hash-ring/) data structures between instances. 14 15 Each instance maintains a copy of the hash rings. 16 Each Pyroscope instance updates a hash ring locally and uses memberlist to propagate the changes to other instances. 17 Updates generated locally and updates received from other instances are merged together to form the current state of the ring on the instance. 18 19 To configure memberlist, refer to [configuring memberlist](../../configure-server/configuring-memberlist/). 20 21 ## How memberlist propagates hash ring changes 22 23 When using a memberlist-based KV store, every Pyroscope instance propagates the hash ring data structures to other instances using the following techniques: 24 25 1. Propagating only the differences introduced in recent changes. 26 1. Propagating the full hash ring data structure. 27 28 Every `-memberlist.gossip-interval` an instance randomly selects a subset of all Pyroscope cluster instances configured by `-memberlist.gossip-nodes` and sends the latest changes to the selected instances. 29 This operation is performed frequently and it's the primary technique used to propagate changes. 30 31 In addition, every `-memberlist.pullpush-interval` an instance randomly selects another instance in the Pyroscope cluster and transfers the full content of the KV store, including all hash rings (unless `-memberlist.pullpush-interval` is zero, which disables this behavior). 32 After this operation is complete, the two instances have the same content as the KV store. 33 This operation is computationally more expensive, and as a result, it's performed less frequently. The operation ensures that the hash rings periodically reconcile to a common state.