6.2.3.2. Gear Capacity Planning for Districts
Due to current constraints, each district can only contain 6000 gears. Therefore, Red Hat
recommends that you avoid placing a large number of nodes in a district. When a district's UID pool is exhausted its nodes will no longer receive additional gears even if they have the capacity, thereby wasting resources. You can remove excess nodes from a district by deactivating them and moving all of their gears away, which is a process known as compacting a district. However, avoid this process if possible to minimize disruption to the gears, and because mass gear movement can be slow and is prone to failure.
Districts exist to facilitate gear movement; the only advantage to having more than two or three nodes in a district is that fewer districts exist requiring maintenance. It is easy to add nodes to a district, and difficult to remove them. Therefore, adding nodes to districts conservatively is wise, and it is simplest to plan for districts with two or three nodes.
With perfect knowledge, calculating how many nodes to put in each district is a function of the following values:
D = district capacity (6000) G = total number of gears per node
D = district capacity (6000)
G = total number of gears per node
However, the total number of gears per node is not limited. To project this number, one of the values to consider is the node capacity for active gears:
C = node capacity (max_active_gears)
C = node capacity (max_active_gears)
For deployments that use the idler on inactive gears, or that stop many applications, the percentage of active gears over a long period of time may be very low. Remember that even though the broker continues to fill the nodes to the active limit when gears are stopped or idled, the district capacity must also contain all of those inactive gears.
Therefore, to roughly project how many gears a full node can ultimately contain (G), determine the following value (estimating at first, then adjusting):
A = percentage of gears that are active
A = percentage of gears that are active
Then the estimate of how many gears a full node can ultimately contain is:
G = C * 100 / A
G = C * 100 / A
Thus, the formula for determining the number of nodes per district is:
N = 6000 * A / (100 * C)
N = 6000 * A / (100 * C)
Using the above formula, consider the following example.
Example 6.2. Example Nodes per District Calculation
If only 10% of gears are active over time, and
max_active_gears is 50, calculate the following:
6000 * 10 / (100 * 50) = 12 (round down if needed)
6000 * 10 / (100 * 50) = 12 (round down if needed)
In this example, twelve nodes should be added per district.
However, in performing this calculation with imperfect knowledge, it is best to be conservative by guessing a low value of active gears and a high value for the node capacity. Adding nodes later is much better than compacting districts.