Calculating Memory Allocation per Host in a Cluster
In disaster recovery (DR) the secondary cluster should have slightly more memory than the primary.
REBALANCE PARTITIONS , as well as large deletes.
Allocate enough memory per leaf and per aggregator in the secondary cluster to store the same amount of data as the primary.
The steps are as follows:
If there is one aggregator and one leaf, then allocate avg_
If there are two leaves then allocate 2 * avg_
You can find the total memory usage from the
SHOW STATUS EXTENDED command in the client, and
Total_ which indicates the usage.
Run this command to see the current total memory usage for all nodes:
SELECT * FROM INFORMATION_SCHEMA.MV_GLOBAL_STATUS WHERE VARIABLE_NAME = 'Total_server_memory';
Assume it returns the result as:
Memory use of nodes: 10.0.3.202:3306Total_server_memory 464.0 MBMemory use of nodes: 10.0.3.101:3306Total_server_memory 460.0 MBMemory use of nodes: 10.0.3.303:3306Total_server_memory 462.5 MBMemory use of nodes: 10.0.3.202:3307Total_server_memory 1459.0 MBMemory use of nodes: 10.0.3.101:3307Total_server_memory 1458.9 MBMemory use of nodes: 10.0.3.303:3307Total_server_memory 1475.0 MBMemory use of nodes: 10.0.3.404:3306Total_server_memory 1435.0 MBMemory use of nodes: 10.0.3.404:3307Total_server_memory 1448.9 MB
Next total the memory consumption by role.
Aggregator memory consumption: 464 + 460 + 463 = 1387
Leaf memory consumption: 1459 + 1459 + 1475 + 1435 + 1448 = 7277
Finally, divide this number by the count of each role in the secondary cluster.
If you were to reduce to only one master aggregator (MA), one child aggregator (CA), and four leaves then:
Aggregators: 1387 / 2 = 694
Leaf nodes: 7277 /4 = 1820
If each host is going to have two nodes then the minimum allocations to support current usage would be:
MA + leaf: 694 + 1820 = 2514
CA + leaf: 694 + 1820 = 2514
2 * leaf: 1820 + 1820 = 3640
In this example, these are the minimum memory allocations per leaf in the secondary cluster to support current usage.
Last modified: April 26, 2023