Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pd-control: add new config of balance-hot-region-scheduler #6148

Merged
merged 13 commits into from
Aug 23, 2021
59 changes: 53 additions & 6 deletions pd-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -720,30 +720,52 @@ Usage:
{
"min-hot-byte-rate": 100,
"min-hot-key-rate": 10,
"min-hot-query-rate": 10,
"max-zombie-rounds": 3,
"max-peer-number": 1000,
"byte-rate-rank-step-ratio": 0.05,
"key-rate-rank-step-ratio": 0.05,
"query-rate-rank-step-ratio": 0.05,
"count-rank-step-ratio": 0.01,
"great-dec-ratio": 0.95,
"minor-dec-ratio": 0.99,
"src-tolerance-ratio": 1.02,
"dst-tolerance-ratio": 1.02
"src-tolerance-ratio": 1.05,
"dst-tolerance-ratio": 1.05,
"read-priorities": [
"query",
"byte"
],
"write-leader-priorities": [
"key",
"byte"
],
"write-peer-priorities": [
"byte",
"key"
],
"strict-picking-store": "true",
"enable-for-tiflash": "true"
}
```

- `min-hot-byte-rate` means the smallest byte counted, which is usually 100.
- `min-hot-byte-rate` means the smallest number of bytes to be counted, which is usually 100.

```bash
>> scheduler config balance-hot-region-scheduler set min-hot-byte-rate 100
```

- `min-hot-key-rate` means the smallest key counted, which is usually 10.
- `min-hot-key-rate` means the smallest number of keys to be counted, which is usually 10.

```bash
>> scheduler config balance-hot-region-scheduler set min-hot-key-rate 10
```

- `min-hot-query-rate` means the smallest number of queries to be counted, which is usually 10.

```bash
>> scheduler config balance-hot-region-scheduler set min-hot-query-rate 10
```

- `max-zombie-rounds` means the maximum number of heartbeats with which an operator can be considered as the pending influence. If you set it to a larger value, more operators might be included in the pending influence. Usually, you do not need to adjust its value. Pending influence refers to the operator influence that is generated during scheduling but still has an effect.

```bash
Expand All @@ -756,7 +778,7 @@ Usage:
>> scheduler config balance-hot-region-scheduler set max-peer-number 1000
```

- `byte-rate-rank-step-ratio`, `key-rate-rank-step-ratio`, and `count-rank-step-ratio` respectively mean the step ranks of byte, key, and count. The rank step ratio decides the step when the rank is calculated. `great-dec-ratio` and `minor-dec-ratio` are used to determine the `dec` rank. Usually, you do not need to modify these items.
- `byte-rate-rank-step-ratio`, `key-rate-rank-step-ratio`, `query-rate-rank-step-ratio`, and `count-rank-step-ratio` respectively mean the step ranks of byte, key, query, and count. The rank-step-ratio decides the step when the rank is calculated. `great-dec-ratio` and `minor-dec-ratio` are used to determine the `dec` rank. Usually, you do not need to modify these items.

```bash
>> scheduler config balance-hot-region-scheduler set byte-rate-rank-step-ratio 0.05
Expand All @@ -765,7 +787,32 @@ Usage:
- `src-tolerance-ratio` and `dst-tolerance-ratio` are configuration items for the expectation scheduler. The smaller the `tolerance-ratio`, the easier it is for scheduling. When redundant scheduling occurs, you can appropriately increase this value.

```bash
>> scheduler config balance-hot-region-scheduler set src-tolerance-ratio 1.05
>> scheduler config balance-hot-region-scheduler set src-tolerance-ratio 1.1
Liuxiaozhen12 marked this conversation as resolved.
Show resolved Hide resolved
```

- `read-priorities`,`write-leader-priorities`, and `write-peer-priorities` control which dimensions have the priority for hot Region scheduling and support two dimensions.
Liuxiaozhen12 marked this conversation as resolved.
Show resolved Hide resolved

- `read-priorities` and `write-leader-priorities` control the dimensions to be prioritized for read and write-leader hot Region scheduling. The available dimensions are `query`, `byte` and `key`.
Liuxiaozhen12 marked this conversation as resolved.
Show resolved Hide resolved
- `write-peer-priorities` controls the dimension to be prioritized for write-peer hot Region scheduling. The available dimensions are `byte` and `key`.
Liuxiaozhen12 marked this conversation as resolved.
Show resolved Hide resolved

> **Note:**
>
> If not all the cluster components are upgraded to v5.2 and later, the configuration of `query` dimension does not take effect. If some components are upgraded, the `byte` and `key` dimensions still by default have the priority for hot Region scheduling. If all the components of the cluster are upgraded to v5.2 and later, such a compatible configuration still takes effect. You can view the real-time configuration using `pd-ctl` command. Usually, you do not need to modify these configurations.
Liuxiaozhen12 marked this conversation as resolved.
Show resolved Hide resolved

```bash
>> scheduler config balance-hot-region-scheduler set read-priorities query,byte
```

- `strict-picking-store` controls the search space of hot Region scheduling. Usually it is enabled. When it is enabled, hot Region scheduling ensures the balance between the two configured dimensions. When it is disabled, hot Region scheduling only ensures the balance of dimensions with the first priority, which might reduce the balance of other dimensions. Usually, you do not need to modify this configuration.
Liuxiaozhen12 marked this conversation as resolved.
Show resolved Hide resolved

```bash
>> scheduler config balance-hot-region-scheduler set strict-picking-store true
```

- `enable-for-tiflash` controls whether hot Region scheduling takes effect for TiFlash. Usually it is enabled. When it is disabled, the hot Region scheduling between TiFlash instances do not start.
Liuxiaozhen12 marked this conversation as resolved.
Show resolved Hide resolved

```bash
>> scheduler config balance-hot-region-scheduler set enable-for-tiflash true
```

### `store [delete | label | weight | remove-tombstone | limit | limit-scene] <store_id> [--jq="<query string>"]`
Expand Down