Wait events

2025-07-25 05:50:59  Updated

This topic describes the monitoring metrics related to wait events within an OceanBase Database tenant. OceanBase Cloud Platform (OCP) provides the following metrics to collect statistics on the number of wait events that occur per second: all, application_wait, configuration_lock_wait, administrative_wait, concurrency_wait, commit_wait, network_wait, user_io_wait, system_io_wait, cluster_wait, and other_wait. You can specify a statistical period to query the wait event metrics of a tenant in a single zone or on a single OBServer node.

all

Definition

The total number of wait events that occur per second in the tenant within the specified statistical period.

Description

Metric Metric name Unit
all wait_event_count times/s

Calculation expression

sum(rate(ob_waitevent_wait_total{@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • OceanBase Database of a version earlier than 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_id
    
  • OceanBase Database V4.0 and later:

    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
    

application_wait

Definition

The number of wait events of the APPLICATION class that occur per second in the tenant within the specified statistical period.

Description

Metric Metric name Unit
application_wait system_event_application_total_waits times/s

Calculation expression

sum(rate(ob_system_event_total_waits{event_group="CONFIGURATION",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • OceanBase Database of a version earlier than V4.0:

    select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, wait_class as 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
    
  • OceanBase Database V4.0 and later:

    select /* MONITOR_AGENT */ con_id tenant_id, wait_class as 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
    

configuration_lock_wait

Definition

The number of wait events of the CONFIGURATION class that occur per second in the tenant within the specified statistical period.

Description

Metric Metric name Unit
configuration_lock_wait system_event_configuration_total_waits times/s

Calculation expression

sum(rate(ob_system_event_total_waits{event_group="CONFIGURATION",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • OceanBase Database of a version earlier than V4.0:

    select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, wait_class as 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
    
  • OceanBase Database V4.0 and later:

    select /* MONITOR_AGENT */ con_id tenant_id, wait_class as 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
    

administrative_wait

Definition

The number of wait events of the ADMINISTRATIVE class that occur per second in the tenant within the specified statistical period.

Description

Metric Metric name Unit
administrative_wait system_event_administrative_total_waits times/s

Calculation expression

sum(rate(ob_system_event_total_waits{event_group="ADMINISTRATIVE",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • OceanBase Database of a version earlier than V4.0:

    select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, wait_class as 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
    
  • OceanBase Database V4.0 and later:

    select /* MONITOR_AGENT */ con_id tenant_id, wait_class as 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
    

concurrency_wait

Definition

The number of wait events of the CONCURRENCY class that occur per second in the tenant within the specified statistical period.

Description

Metric Metric name Unit
concurrency_wait system_event_concurrency_total_waits times/s

Calculation expression

sum(rate(ob_system_event_total_waits{event_group="CONCURRENCY",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • OceanBase Database of a version earlier than V4.0:

    select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, wait_class as 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
    
  • OceanBase Database V4.0 and later:

    select /* MONITOR_AGENT */ con_id tenant_id, wait_class as 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
    

commit_wait

Definition

The number of wait events of the COMMIT class that occur per second in the tenant within the specified statistical period.

Description

Metric Metric name Unit
commit_wait system_event_commit_total_waits times/s

Calculation expression

sum(rate(ob_system_event_total_waits{event_group="COMMIT",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • OceanBase Database of a version earlier than V4.0:

    select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, wait_class as 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
    
  • OceanBase Database V4.0 and later:

    select /* MONITOR_AGENT */ con_id tenant_id, wait_class as 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
    

network_wait

Definition

The number of wait events of the NETWORK class that occur per second in the tenant within the specified statistical period.

Description

Metric Metric name Unit
network_wait system_event_network_total_waits times/s

Calculation expression

sum(rate(ob_system_event_total_waits{event_group="NETWORK",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • OceanBase Database of a version earlier than V4.0:

    select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, wait_class as 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
    
  • OceanBase Database V4.0 and later:

    select /* MONITOR_AGENT */ con_id tenant_id, wait_class as 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
    

user_io_wait

Definition

The number of wait events of the USER_IO class that occur per second in the tenant within the specified statistical period.

Description

Metric Metric name Unit
user_io_wait system_event_user_io_total_waits times/s

Calculation expression

sum(rate(ob_system_event_total_waits{event_group="USER_IO",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • OceanBase Database of a version earlier than V4.0:

    select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, wait_class as 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
    
  • OceanBase Database V4.0 and later:

    select /* MONITOR_AGENT */ con_id tenant_id, wait_class as 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
    

system_io_wait

Definition

The number of wait events of the SYSTEM_IO class that occur per second in the tenant within the specified statistical period.

Description

Metric Metric name Unit
system_io_wait system_event_system_io_total_waits times/s

Calculation expression

sum(rate(ob_system_event_total_waits{event_group="SYSTEM_IO",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • OceanBase Database of a version earlier than V4.0:

    select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, wait_class as 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
    
  • OceanBase Database V4.0 and later:

    select /* MONITOR_AGENT */ con_id tenant_id, wait_class as 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
    

cluster_wait

Definition

The number of wait events of the CLUSTER class that occur per second in the tenant within the specified statistical period.

Description

Metric Metric name Unit
cluster_wait system_event_cluster_total_waits times/s

Calculation expression

sum(rate(ob_system_event_total_waits{event_group="CLUSTER",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • OceanBase Database of a version earlier than V4.0:

    select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, wait_class as 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
    
  • OceanBase Database V4.0 and later:

    select /* MONITOR_AGENT */ con_id tenant_id, wait_class as 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

Definition

The number of wait events of the OTHER class that occur per second in the tenant within the specified statistical period.

Description

Metric Metric name Unit
other_wait system_event_other_total_waits times/s

Calculation expression

sum(rate(ob_system_event_total_waits{event_group="OTHER",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • OceanBase Database of a version earlier than V4.0:

    select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, wait_class as 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
    
  • OceanBase Database V4.0 and later:

    select /* MONITOR_AGENT */ con_id tenant_id, wait_class as 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
    

Contact Us