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: add rank-formula-version config for hot scheduler #11566

Merged
merged 7 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion experimental-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ aliases: ['/docs-cn/dev/experimental-features-4.0/','/zh/tidb/dev/experimental-f

## 调度功能

弹性调度功能。结合 Kubernetes,可根据实时负载状态,动态扩缩节点,能够有效地缓解业务高峰的压力并且节约不必要的成本开销。详情参阅:[启用 TidbCluster 弹性伸缩](https://docs.pingcap.com/zh/tidb-in-kubernetes/stable/enable-tidb-cluster-auto-scaling)。(v4.0 实验特性)
+ 弹性调度功能。结合 Kubernetes,可根据实时负载状态,动态扩缩节点,能够有效地缓解业务高峰的压力并且节约不必要的成本开销。详情参阅:[启用 TidbCluster 弹性伸缩](https://docs.pingcap.com/zh/tidb-in-kubernetes/stable/enable-tidb-cluster-auto-scaling)。(v4.0 实验特性)
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved
+ [调整 PD 中的热点均衡调度器使用的算法版本](./pd-control.md#scheduler-config-balance-hot-region-scheduler)
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved

## SQL 功能

Expand Down
19 changes: 17 additions & 2 deletions pd-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,8 @@ scheduler config balance-hot-region-scheduler // 显示 balance-hot-region 调
"key"
],
"strict-picking-store": "true",
"enable-for-tiflash": "true"
"enable-for-tiflash": "true",
"rank-formula-version": "v1"
}
```

Expand Down Expand Up @@ -1234,12 +1235,26 @@ scheduler config balance-hot-region-scheduler // 显示 balance-hot-region 调
scheduler config balance-hot-region-scheduler set read-priorities query,byte
```

- `strict-picking-store` 是控制热点调度搜索空间的开关,通常为打开。当打开时,热点调度的目标是保证所配置的两个维度的热点均衡。当关闭后,热点调度只保证处于第一优先级的维度的热点均衡表现更好,但可能会导致其他维度的热点不再那么均衡。通常用户不需要修改这个配置项。
- `strict-picking-store` 是控制热点调度搜索空间的开关,通常为打开。该配置项仅影响 `rank-formula-version` 为 `v1` 时的行为。当打开时,热点调度的目标是保证所配置的两个维度的热点均衡。当关闭后,热点调度只保证处于第一优先级的维度的热点均衡表现更好,但可能会导致其他维度的热点不再那么均衡。通常用户不需要修改这个配置项。

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

- `rank-formula-version` 适用于热点调度,其用来确定调度策略的算法版本,支持的值有 `["v1", "v2"]`。目前该配置的默认值为 `v1`。

- `v1` 版本为 v6.3.0 之前的策略,主要关注调度是否降低了不同 Store 之间的负载差值,以及是否在另一维度引入副作用。
- `v2` 版本是 v6.3.0 引入的实验特性算法,主要关注 Store 之间均衡度的提升率,同时降低了对副作用的关注度。对比 `strict-picking-store` 为 `true` 的 `v1` 算法,`v2` 版本更注重优先均衡第一维度;对比 `strict-picking-store` 为 `false` 的 `v1` 算法,`v2` 版本兼顾了第二维度的均衡。
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved
- `strict-picking-store` 为 `true` 的 `v1` 版本算法较为保守,只有当存在两个维度的负载都偏高的 Store 时才能产生调度。在特定场景下有可能因为维度冲突导致无法继续均衡,需要将 `strict-picking-store` 改为 `false` 才能在第一维度取得更好的均衡效果。`v2` 版本算法则可以在两个维度都取得更好的均衡效果,并减少无效调度。

> **警告:**
>
> 将 `rank-formula-version` 设置为 `v2` 目前为实验性特性,不建议在生产环境中使用。

```bash
scheduler config balance-hot-region-scheduler set rank-formula-version v2
```

- `enable-for-tiflash` 是控制热点调度是否对 TiFlash 生效的开关。通常为打开,关闭后将不会产生 TiFlash 实例之间的热点调度。

```bash
Expand Down