This topic explains automated rebalancing of partitioned region data in VMware Tanzu GemFire.
Note: This feature is experimental and is subject to change in future releases of Tanzu GemFire.
Automated rebalance triggers a rebalance (see Rebalancing Partitioned Region Data) operation based on a time schedule. At the scheduled intervals, the balance of the partitioned regions is evaluated based on configured criteria. One criterion is a minimum threshold for number of bytes that would be transferred if the rebalance takes place. The other criterion uses the ratio of the number of bytes that would be transferred to the total number of bytes in the regions. If the evaluation indicates the system is out of balance, the rebalance transfer is initiated.
To enable automated rebalance, specify the rebalance manager in the <initializer>
attribute within the <cache>
configuration of the cache.xml
file:
<class-name> org.apache.geode.cache.util.AutoBalancer </class-name>
The time schedule that triggers an evaluation and possible rebalance uses a cron-based specification in the <initializer>
attribute within the <cache>
configuration of the cache.xml
file. This scheduling specification is required. Specify the cron expression in the Spring format. This example specification triggers each Saturday at 3am:
<parameter name="schedule"> 0 0 3 ? * SAT </parameter>
This example specification triggers once each day at 4am:
<parameter name="schedule"> 0 0 4 * * ?</parameter>
The automated rebalance specifications that specify criteria for triggering the rebalance are optional and have reasonable default values.
One criterion is a minimum number of bytes that would be transferred if the rebalance were to take place. The specification is in units of bytes. This example shows the specification for the default value of 100 MB:
<parameter name="minimum-size"> 104857600 </parameter>
Another criterion represents the ratio of bytes that would be transferred to the total number of bytes in the partitioned regions, represented as an integer percentage. The default is 10 percent. This example specifies 15 percent:
<parameter name="size-threshold-percent"> 15 </parameter>