问题背景:
上图是tidb集群中各个节点使用grpc通信的架构
问题描述:
如何在tidb集群运行时,将节点间使用grpc进行传输的message统计出来,包括每种message的类型,字节数,一段时间内的频率?
想知道如何在tidb上运行一个benchmark时,打印出节点使用grpc进行传输的message信息。
目前使用docker容器搭建了一个tidb测试集群,并使用了tidb监控工具,但消息不够具体。
问题背景:
上图是tidb集群中各个节点使用grpc通信的架构
问题描述:
如何在tidb集群运行时,将节点间使用grpc进行传输的message统计出来,包括每种message的类型,字节数,一段时间内的频率?
想知道如何在tidb上运行一个benchmark时,打印出节点使用grpc进行传输的message信息。
目前使用docker容器搭建了一个tidb测试集群,并使用了tidb监控工具,但消息不够具体。
目前没有直接统计 tikv 节点间传输消息个数和字节数的监控。
tikv 间的传输的消息为 RaftMessage ,可以通过 TiKV-Details 的 Raft Message 相关面板看到每个节点发出的消息数(但无法精准的统计如节点 A → 节点 B 的消息数)
@LeZeJ, TiDB 有提供一些监控系统表,可以尝试用以下 SQL 查询:
use METRICS_SCHEMA;
-- 查询 TiDB 向 TiKV 发送 grpc 请求的总数量,按照请求类型分类
select sum(value) sum,type from tidb_kv_request_total_count where value > 0 and time > '2020-10-21 16:45:00' and time < '2020-10-21 16:55:00' group by type order by sum desc;
-- 查询 TiDB 向 TiKV 发送 grpc 请求的耗时,按照请求类型分类
select sum(value) sum,type from tidb_kv_request_total_time where value > 0 and time > '2020-10-21 16:45:00' and time < '2020-10-21 16:55:00' group by type order by sum desc;
-- 查询 TiKV 处理 grpc 请求的总数量,按照请求类型分类
select sum(value) sum,type from tikv_grpc_message_total_count where value > 0 and time > '2020-10-21 16:45:00' and time < '2020-10-21 16:55:00' group by type order by sum desc;
-- 查询 TiKV 处理 grpc 请求的总耗时,按照请求类型分类
select sum(value) sum,type from tikv_grpc_message_total_time where value > 0 and time > '2020-10-21 16:45:00' and time < '2020-10-21 16:55:00' group by type order by sum desc;
-- 查询发送给 PD 的 grpc 请求的总数量,按照请求类型分类
select sum(value) sum,type from pd_request_rpc_total_count where value > 0 and time > '2020-10-21 16:45:00' and time < '2020-10-21 16:55:00' group by type order by sum desc;
-- 查询发送给 PD 的 grpc 请求的总耗时,按照请求类型分类
select sum(value) sum,type from pd_request_rpc_total_time where value > 0 and time > '2020-10-21 16:45:00' and time < '2020-10-21 16:55:00' group by type order by sum desc;
METRICS_SCHEMA 的文档:https://docs.pingcap.com/zh/tidb/stable/metrics-schema