负载均衡相关

【概述】因为官方文档对于balance时各个region的分数计算没有说的太明确,所以去看源码想弄清楚region具体的得分计算方式。在阅读 pd/server/core/store.go时,发现计算region score时有一个deviation参数,对这个参数的注释没能理解,该参数注释如下:

// Deviation It is used to control the direction of the deviation considered

// when calculating the region score. It is set to -1 when it is the source

// store of balance, 1 when it is the target, and 0 in the rest of cases.
或者能有更具体的文档资料提供吗?

【TiDB 版本】
V5.1.0

1 个赞

网上没什么关于TiDB 负载均衡部分逻辑的资料 对这部分比较感兴趣 能分享些资料吗?

这个和设计相关阿,有资料的

https://docs.pingcap.com/zh/tidb/v4.0/information-schema-tikv-region-status#tikv_region_status
https://docs.pingcap.com/zh/tidb/v4.0/information-schema-tidb-hot-regions#tidb_hot_regions
https://docs.pingcap.com/zh/tidb/v4.0/massive-regions-best-practices#海量-region-集群调优最佳实践

可以选择手动的调整,也可以按照实际的场景配置调整,都可以

参考博客https://pingcap.com/blog-cn/pd-scheduler/
博客没有细说,就指明了两点,计算和存储。

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。