此内容没有您所选择的语言版本。
25.4. Distributed Garbage Collection (STABLE)
In a JGroups cluster, all nodes must store all messages received for potential retransmission in case of a failure. However, if we store all messages forever, we will run out of memory. The distributed garbage collection service periodically purges messages that have been seen by all nodes, removing them from the memory in each node. The distributed garbage collection service is configured in the
pbcast.STABLE sub-element under the JGroups config element. Here is an example configuration.
<pbcast.STABLE stability_delay="1000"
desired_avg_gossip="5000"
max_bytes="400000"/>
<pbcast.STABLE stability_delay="1000"
desired_avg_gossip="5000"
max_bytes="400000"/>
The configurable attributes in the
pbcast.STABLE element are as follows.
- desired_avg_gossip specifies intervals (in milliseconds) of garbage collection runs. Set this to
0to disable interval-based garbage collection. - max_bytes specifies the maximum number of bytes received before the cluster triggers a garbage collection run. Set to
0to disable garbage collection based on the bytes received. - stability_delay specifies the maximum time period (in milliseconds) of a random delay introduced before a node sends its
STABILITYmessage at the end of a garbage collection run. The delay gives other nodes concurrently running aSTABLEtask a chance to send first. If used together withmax_bytes, this attribute should be set to a small number.
Note
Set the
max_bytes attribute when you have a high traffic cluster.