【OceanBase 诊断调优】—— ocp上针对OB租户CPU消耗计算逻辑

指标介绍

租户 CPU 使用量 * 100 / 租户 CPU 分配量。

指标参数说明

指标项 指标名称 单位
租户 CPU 消耗 ob_tenant_cpu_percent %

计算表达式

sum(rate(ob_sysstat{stat_id="140013",@LABELS}@INTERVAL)) by (@GBLABELS) / sum(ob_sysstat{stat_id="140005",@LABELS}) by (@GBLABELS) / 100

参考sysstat监控项含义:

|---------|----------|------------------|----|---------|
| stat_id | name | 意义 | 单位 | 变量类型 |
| 140005 | max cpus | 每个租户的 CPU 分配量 | 个 | int64_t |
| 140013 | cpu time | 每个租户的所有线程累计cpu时间 | 微秒 | int64_t |

采集 SQL

  • OceanBase V4.0 以下版本:

    复制代码
    select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from gv$sysstat where stat_id IN (140005, 140013) and (con_id > 1000 or con_id = 1)
  • OceanBase V4.0 及以上版本:

    复制代码
    select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from gv$sysstat where stat_id IN (140005, 140013) and (con_id > 1000 or con_id = 1

QA

问:ocp查询租户的监控指标 租户 CPU 消耗查不到的原因是什么?

答:需同时满足observer内核版本和ocp版本的要求。

observer内核版本需满足如下及更新的版本:3.2.3 BP10、3.2.4 BP5、4.1 BP3、4.2

ocp版本需满足如下及更新的版本: 3.3.5 BP1、4.1.0 BP2、4.2.0

问:现在租户CPU的使用率,转储和合并的cpu消耗会体现在cpu time中吗?

答:在3.x版本下,转储和合并有自己的后台线程,不会体现在cpu time中。

在4.x版本下,转储和合并已经拆租户,会体现在cpu time中。

相关推荐
yzs875 天前
OceanBase的向量化引擎shuffle有多强?
oceanbase
小码过河.6 天前
oceanbase表分区变更流程(从8到10)
oceanbase
小码过河.6 天前
oceanbase中zone和observer、分区表之间关系
前端·数据库·oceanbase
小码过河.6 天前
oceanbase根据时间自动新增表分区
oceanbase
小码过河.6 天前
oceanbase表分区指定
oceanbase
喂自己代言7 天前
从 0.7 秒到 11 毫秒:OceanBase 一条慢 SQL 的三连坑优化实战
数据库·sql·oceanbase
marvelyu9 天前
OceanBase 调优实战:从慢查询到高并发的系统性优化
oceanbase
2601_9620715715 天前
基于DataX迁移MySQL到OceanBase集群
数据库·mysql·oceanbase
光锥智能17 天前
OceanBase领跑数字政府数据库选型:产品能力、市场潜力、技术潜力均居首
数据库·人工智能·oceanbase
数智前线18 天前
服务22个省数字政府建设,OceanBase领跑数字政府数据库选型
oceanbase