基于湖库一体架构,统一管理结构化、半结构化与非结构化等多模态数据,一个系统承载事务处理、实时分析与 AI 工作负载。
等待事件
更新时间:2023-11-21 09:58:00
本节为您介绍 OceanBase 租户的监控指标 等待事件 。等待事件指每秒发生等待事件的次数,OCP 根据等待事件类型提供如下 7 个细分指标来分别统计不同类型的等待事件每秒的发生的次数,分别为:all(每秒等待事件次数)、internal_wait(每秒内部等待事件次数)、sync_rpc_wait(每秒同步 RPC 等待事件次数)、row_lock_wait(每秒锁等待事件次数)、io_wait(每秒 IO 等待事件次数)、latch_wait(每秒 latch 等待事件次数)、other_wait(每秒其他等待事件次数)。您可指定统计范围,查询租户在单个 Zone 或 OBServer 节点的 等待事件 数据。
all
指标介绍
统计范围内,租户每秒发生的等待事件次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| all | wait_event_count | 次 |
计算表达式
sum(rate(ob_waitevent_wait_total{@LABELS}[@INTERVAL])) by (@GBLABELS)
采集 SQL
OceanBase V4.0 以下版本:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, sum(total_waits) as total_waits, sum(time_waited_micro) / 1000000 as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_idOceanBase V4.0 及以上版本:
select /* MONITOR_AGENT */ con_id tenant_id, sum(total_waits) as total_waits, sum(time_waited_micro) / 1000000 as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id
internal_wait
指标介绍
统计范围内,租户每秒发生的内部等待事件次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| internal_wait | system_event_internal_total_waits | 次 |
计算表达式
sum(rate(ob_system_event_total_waits{event_group="INTERNAL",@LABELS}[@INTERVAL])) by (@GBLABELS)
采集 SQL
OceanBase V4.0 以下版本:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupOceanBase V4.0 及以上版本:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group
sync_rpc_wait
指标介绍
统计范围内,租户每秒发生的同步 RPC 等待事件次数。
同步 RPC 等待事件指从发送 RPC 请求到请求结果返回这段时间产生的等待。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| sync_rpc_wait | system_event_sync_rpc_total_waits | 次 |
计算表达式
sum(rate(ob_system_event_total_waits{event_group="SYNC_RPC",@LABELS}[@INTERVAL])) by (@GBLABELS)
采集 SQL
OceanBase V4.0 以下版本:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupOceanBase V4.0 及以上版本:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group
row_lock_wait
指标介绍
统计范围内,租户每秒发生的锁等待事件次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| row_lock_wait | system_event_row_lock_wait_total_waits | 次 |
计算表达式
sum(rate(ob_system_event_total_waits{event_group="ROW_LOCK_WAIT",@LABELS}[@INTERVAL])) by (@GBLABELS)
采集 SQL
OceanBase V4.0 以下版本:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupOceanBase V4.0 及以上版本:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group
io_wait
指标介绍
统计范围内,租户每秒发生的 IO 等待事件次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| io_wait | system_event_io_total_waits | 次 |
计算表达式
sum(rate(ob_system_event_total_waits{event_group="IO",@LABELS}[@INTERVAL])) by (@GBLABELS)
采集 SQL
OceanBase V4.0 以下版本:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupOceanBase V4.0 及以上版本:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group
latch_wait
指标介绍
统计范围内,租户每秒发生的 Latch 等待事件次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| latch_wait | system_event_latch_total_waits | 次 |
计算表达式
sum(rate(ob_system_event_total_waits{event_group="LATCH",@LABELS}[@INTERVAL])) by (@GBLABELS)
采集 SQL
OceanBase V4.0 以下版本:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupOceanBase V4.0 及以上版本:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group
other_wait
指标介绍
统计范围内,租户每秒发生的其他等待事件次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| other_wait | system_event_other_total_waits | 次 |
计算表达式
sum(rate(ob_system_event_total_waits{event_group="OTHER",@LABELS}[@INTERVAL])) by (@GBLABELS)
采集 SQL
OceanBase V4.0 以下版本:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupOceanBase V4.0 及以上版本:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group