Chapter 3 Load Balancing Algorithm - Placement Strategy
Last updated
Was this helpful?
Last updated
Was this helpful?
In Chapter 2, we introduced all the implementations of the LoadSheddingStrategy
. In this chapter, we will delve into the implementation principles of the placement strategy and discuss the effects of combining different placement strategies with different LoadSheddingStrategy
implementations. Ultimately, we will present a scoring table that allows readers to clearly see the strengths and weaknesses of different algorithm combinations.
The placement strategy is controlled by the configuration loadBalancerLoadPlacementStrategy
, with the default being the LeastLongTermMessageRate
strategy.
The implemented interface is named org.apache.pulsar.broker.loadbalance.ModularLoadManagerStrategy
, and there are four implementations. Among them, RoundRobinBrokerSelector
is usually not considered because it places bundles using a round robin method without considering key information such as load data. In the following sections, we will focus on the LeastLongTermMessageRate
and LeastResourceUsageWithWeight
implementations, while the content related to AvgShedder
will be covered in the next chapter.