INSPECTION_RESULT 表中 关于tikv 监控表一些参数的优化疑问

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:v4.0.2
  • 【问题描述】:
leader-score-balance     | tikv | 50.00%   | < 5.00%  | x:20160 max leader_score is 20.00, much more than x:20160 min leader_score 10.00                                                                                                                 |
filter-block-cache-hit   | tikv | 0.777    | > 0.950  | min filter-block-cache-hit rate of x:20180 tikv is too low                                                                                                                                                  |
index-block-cache-hit    | tikv | 0.889    | > 0.950  | min index-block-cache-hit rate of x:20180 tikv is too low   

请问这种如何进行优化呢,调整的话需要重启集群吗?

https://docs.pingcap.com/zh/tidb/v4.0/system-table-inspection-result#threshold-check-诊断规则

此表为 tidb 监控表,只反映当前集群情况,无法修改,可以反馈当前出现的问题,这边帮忙分析下

是的,都提示缓存过小,类似这种内存级别参数调整 是否设置sql语句级别动态调整。选择范围全部or单个实例生效以及相关调整计算规则

sorry,还可以在清楚的描述下,

例如监控表这些监控项index-block-cache-hit、filter-block-cache-hit、leader-score-balance对应的值,不知道计算规则。或者说查询时候增加一列字段 列出其计算组成部分的实际指标值。这样的话就能根据不满足选项实际调整(index-block-cache-hit=A+B+C+N=0.889)

查了一下代码

这个表的原理就是 All In SQL
把一个 metrics 指标抓过来,然而检查一下是不是在合理的范围内。

其中就有很多个 rule

	&configInspection{inspectionName: "config"},
	&versionInspection{inspectionName: "version"},
	&nodeLoadInspection{inspectionName: "node-load"},
	&criticalErrorInspection{inspectionName: "critical-error"},
	&thresholdCheckInspection{inspectionName: "threshold-check"},

不同的 rule 做不同的检查,比如其中 thresholdCheckInspection 有一个 index-block-cache-hit

https://github.com/pingcap/tidb/blob/f31298f5bb55d0c37dcd95c30d0253deef6b850e/executor/inspection_result.go#L915

它要判断 tikv 的一个 metric 的 index-block-cache 域值高于 95%

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