Skip to content

Commit 18bc0fc

Browse files
authored
Merge pull request #110748 from MicrosoftDocs/release-sf-7.1
Release sf 7.1
2 parents 81a18a3 + 31584d2 commit 18bc0fc

24 files changed

+1029
-86
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: Balancing of subclustered metrics
3+
description: The effect of placement constraints on balancing and how to handle it
4+
author: nipavlo
5+
6+
ms.topic: conceptual
7+
ms.date: 03/15/2020
8+
ms.author: nipavlo
9+
---
10+
# Balancing of subclustered metrics
11+
12+
## What is subclustering
13+
14+
Subclustering happens when services with different placement constraints have a common metric and they both report load for it. If the load reported by the services differs significantly, the total load on the nodes will have a large standard deviation and it would look like the cluster is imbalanced, even when it has the best possible balance.
15+
16+
## How subclustering affects load balancing
17+
18+
If the load reported by the services on different nodes differs significantly, it may look like there is a large imbalance where there is none. Also, if the false imbalance caused by subclustering is larger than the actual imbalance, it has the potential to confuse the Resource Manager balancing algorithm and to produce suboptimal balance in the cluster.
19+
20+
For example, let's say we have four services and they all report a load for metric Metric1:
21+
22+
* Service A – has a placement constraint "NodeType==Type1", reports a load of 10
23+
* Service B – has a placement constraint "NodeType==Type1", reports a load of 10
24+
* Service C – has a placement constraint "NodeType==Type2", reports a load of 100
25+
* Service D – has a placement constraint "NodeType==Type2", reports a load of 100
26+
* And we have four nodes. Two of them have NodeType set as "Type1" and the other two are "Type2"
27+
28+
And we have the following placement:
29+
30+
<center>
31+
32+
![Subclustered placement example][Image1]
33+
</center>
34+
35+
The cluster may look unbalanced, we have a large load on nodes 3 and 4, but this placement creates the best possible balance in this situation.
36+
37+
Resource Manager can recognize subclustering situations and in almost all cases it can produce the optimal balance for the given situation.
38+
39+
For some exceptional situations when Resource Manager is not able to optimally balance a subclustered metric it will still detect subclustering and it will generate a health report to advise you to fix the problem.
40+
41+
## Types of subclustering and how they are handled
42+
43+
Subclustering situations can be classified into three different categories. The category of a specific subclustering situation determines how it will be handled by Resource Manager.
44+
45+
### First category – flat subclustering with disjoint node groups
46+
47+
This category has the simplest form of subclustering where nodes can be separated into different groups and each service can only be placed onto nodes in one of those groups. Each node belongs to one group and one group only. The situation described above belongs in this category as do most of the subclustering situations.
48+
49+
For the situations in this category, the Resource Manager can produce the optimal balance and no further intervention is needed.
50+
51+
### Second category – subclustering with hierarchical node groups
52+
53+
This situation happens when a group of nodes allowed for one service is a subset of the group of nodes allowed for another service. The most common example of this situation is when some service has a placement constraint defined and another service has no placement constraint and can be placed on any node.
54+
55+
Example:
56+
57+
* Service A: no placement constraint
58+
* Service B: placement constraint "NodeType==Type1"
59+
* Service C: placement constraint "NodeType==Type2"
60+
61+
This configuration creates a subset-superset relation between node groups for different services.
62+
63+
<center>
64+
65+
![Subset superset subclusters][Image2]
66+
</center>
67+
68+
In this situation, there is a chance that a suboptimal balance gets made.
69+
70+
Resource Manager will recognize this situation and produce a health report advising you to split Service A into two services – Service A1 that can be placed on Type1 nodes and Service A2 that can be placed on Type2 nodes. This will bring us back to first category situation that can be balanced optimally.
71+
72+
### Third category – subclustering with partial overlap between node sets
73+
74+
This situation happens when there is a partial overlap between sets of nodes onto which some services can be placed.
75+
76+
For example, if we have a node property called NodeColor and we have three nodes:
77+
78+
* Node 1: NodeColor=Red
79+
* Node 2: NodeColor=Blue
80+
* Node 2: NodeColor=Green
81+
82+
And we have two services:
83+
84+
* Service A: with placement constraint "Color==Red || Color==Blue"
85+
* Service B: with placement constraint "Color==Blue || Color==Green"
86+
87+
Because of this, Service A can be placed on nodes 1 and 2 and Service B can be placed on nodes 2 and 3.
88+
89+
In this situation, there is a chance that a suboptimal balance gets made.
90+
91+
Resource Manager will recognize this situation and produce a health report advising you to split some of the services.
92+
93+
For this situation, the Resource Manager is not able to give a proposal how to split the services, since multiple splits can be done and there is no way to estimate which way would be the optimal one to split the services.
94+
95+
## Configuring subclustering
96+
97+
The behavior of Resource Manager about subclustering can be modified by modifying the following configuration parameters:
98+
* SubclusteringEnabled - parameter determines whether Resource Manager will take subclustering into account when doing load balancing. If this parameter is turned off, Resource Manager will ignore subclustering and try to achieve optimal balance on a global level. The default value of this parameter is false.
99+
* SubclusteringReportingPolicy - determines how Resource Manager will emit health reports for hierarchical and partial-overlap subclustering. A value of zero means that health reports about subclustering are turned off, "1" means that warning health reports will be produced for suboptimal subclustering situations and a value of "2" will produce "OK" health reports. The default value for this parameter is "1".
100+
101+
ClusterManifest.xml:
102+
103+
``` xml
104+
<Section Name="PlacementAndLoadBalancing">
105+
<Parameter Name="SubclusteringEnabled" Value="true" />
106+
<Parameter Name="SubclusteringReportingPolicy" Value="1" />
107+
</Section>
108+
```
109+
110+
via ClusterConfig.json for Standalone deployments or Template.json for Azure hosted clusters:
111+
112+
```json
113+
"fabricSettings": [
114+
{
115+
"name": "PlacementAndLoadBalancing",
116+
"parameters": [
117+
{
118+
"name": "SubclusteringEnabled",
119+
"value": "true"
120+
},
121+
{
122+
"name": "SubclusteringReportingPolicy",
123+
"value": "1"
124+
},
125+
]
126+
}
127+
]
128+
```
129+
130+
## Next steps
131+
* To find out about how the Cluster Resource Manager manages and balances load in the cluster, check out the article on [balancing load](service-fabric-cluster-resource-manager-balancing.md)
132+
* To find out about how your services can be constrained to only be placed on certain nodes see [Node properties and placement constraints](service-fabric-cluster-resource-manager-cluster-description.md#node-properties-and-placement-constraints)
133+
134+
[Image1]:./media/cluster-resource-manager-subclustering/subclustered-placement.png
135+
[Image2]:./media/cluster-resource-manager-subclustering/subset-superset-nodes.png

0 commit comments

Comments
 (0)