> For the complete documentation index, see [llms.txt](https://tumbleds-library.gitbook.io/thetumbleds-library/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tumbleds-library.gitbook.io/thetumbleds-library/chapter-3-load-balancing-algorithm-principles-and-analysis-placement-strategy.md).

# Chapter 3 Load Balancing Algorithm - Placement Strategy

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.

```
# load balance placement strategy, support LeastLongTermMessageRate and LeastResourceUsageWithWeight
loadBalancerLoadPlacementStrategy=org.apache.pulsar.broker.loadbalance.impl.LeastLongTermMessageRate
```

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.

<figure><img src="https://3549286078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fd3bYBC2M7QmbunDfuqpO%2Fuploads%2Fgit-blob-53bb2126c309b1eea63fc311f4e8725f309db097%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://tumbleds-library.gitbook.io/thetumbleds-library/chapter-3-load-balancing-algorithm-principles-and-analysis-placement-strategy.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
