2. LeastResourceUsageWithWeight
2.1 Candidate Broker Pool
final double avgUsage = totalUsage / candidates.size();
final double diffThreshold =
conf.getLoadBalancerAverageResourceUsageDifferenceThresholdPercentage() / 100.0;
candidates.forEach(broker -> {
Double avgResUsage = brokerAvgResourceUsageWithWeight.getOrDefault(broker, MAX_RESOURCE_USAGE);
if ((avgResUsage + diffThreshold <= avgUsage)) {
bestBrokers.add(broker);
}
});# The broker average resource usage difference threshold.
# Average resource usage difference threshold to determine a broker whether to be a best candidate in LeastResourceUsageWithWeight.
# (eg: broker1 with 10% resource usage with weight and broker2 with 30% and broker3 with 80% will have 40% average resource usage.
# The placement strategy can select broker1 and broker2 as best candidates.)
# It only takes effect in the LeastResourceUsageWithWeight strategy.
loadBalancerAverageResourceUsageDifferenceThresholdPercentage=102.2 Historical Weight Algorithm
2.3 Algorithm Combinations
Last updated
Was this helpful?

