【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中。

相关推荐
运维小斌2 天前
麒麟 V10 部署 OceanBase:故障速查与验收清单
linux·数据库·oceanbase·麒麟
云贝贝贝3 天前
白天稳如狗半夜就抖:OceanBase 合并转储把读写延迟顶了上去
数据库·sql·oceanbase
库库的数据库笔记3 天前
国产信创数据库的MySQL兼容性深度对比解析
大数据·数据库·mysql·oceanbase·政务
NineData5 天前
MySQL 迁移到 OceanBase 怎么做?NineData 全量迁移、CDC 实时同步与数据校验指南
数据库·mysql·oceanbase
运维小斌7 天前
麒麟 V10 ARM64 离线部署 OceanBase:8 步实施手册
linux·数据库·oceanbase·麒麟
OceanBase数据库官方博客10 天前
OceanBase 亮相亚马逊云科技峰会分享全球化实践(技术解析与实践)
科技·oceanbase
OceanBase数据库官方博客12 天前
被 VLDB 2027接收OceanBase 最新论文让数据库基(技术解析与实践)
数据库·人工智能·oceanbase
knqiufan18 天前
MiniMax Code 接入 PowerContext:构建跨会话与跨 Agent 的项目上下文底座
ai·oceanbase·minimax·powercontext
最笨的羊羊18 天前
Oceanbase数据库系列之:向量数据库核心知识
数据库·oceanbase
星航夜空的帆舟18 天前
OceanBase源码架构总览
架构·oceanbase