---
title: "QPS | OceanBase 文档中心"
description: QPS 本节为您介绍 OceanBase 集群的性能指标 QPS （Query Per Second）。 QPS 指标用于统计集群每秒处理 SQL 语句的次数，该指标根据处理的 SQL 语句类型细分为如下几个子指标：all、select、insert、replace、update、delete、other。您可指定统…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*lJTmRZ61jSUAAAAAAAAAAAAADiGDAQ/original) 云平台 OCPV 4.0.3 企业版

# QPS

更新时间：2024-03-21 10:40:53

本节为您介绍 OceanBase 集群的性能指标 **QPS** （Query Per Second）。 **QPS** 指标用于统计集群每秒处理 SQL 语句的次数，该指标根据处理的 SQL 语句类型细分为如下几个子指标：all、select、insert、replace、update、delete、other。您可指定统计范围，查询 OceanBase 集群在单个 Zone 或 OBServer 节点的 **QPS** 数据。

## all

### 指标介绍

OceanBase 集群每秒处理 SQL 语句的次数。

### 指标参数说明

| 指标项 | **指标名称** | **单位** |
| --- | --- | --- |
| all | sql_all_count | 次 |

### 计算表达式

sum(rate(ob_sysstat{stat_id="40000",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40002",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40004",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40006",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40008",@LABELS}[@INTERVAL])) by (@GBLABELS) R_FILL_0_ADD sum(rate(ob_sysstat{stat_id="40018",@LABELS}[@INTERVAL])) by (@GBLABELS)

### SQL 采集

- OceanBase V4.0 以下版本：

  ```sql
  select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40000, 40002, 40004, 40006, 40008, 40018) and (con_id > 1000 or con_id = 1) and class < 1000

  ```
 - OceanBase V4.0 及以上版本：

  ```sql
  select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40000, 40002, 40004, 40006, 40008, 40018) and (con_id > 1000 or con_id = 1) and class < 1000

  ```

## select

### 指标介绍

每秒处理 SELECT 语句次数。

### 指标参数说明

| **指标项** | **指标名称** | **单位** |
| --- | --- | --- |
| select | sql_select_count | 次 |

### 计算表达式

sum(rate(ob_sysstat{stat_id="40000",@LABELS}[@INTERVAL])) by (@GBLABELS)

  ```sql
  select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40000) and (con_id > 1000 or con_id = 1) and class < 1000

  ```sql
  select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40000) and (con_id > 1000 or con_id = 1) and class < 1000

  ```

## insert

### 指标介绍

每秒处理 INSERT 语句次数。

### 指标参数说明

| **指标项** | **指标名称** | **单位** |
| --- | --- | --- |
| insert | sql_insert_count | 次 |

### 计算表达式

sum(rate(ob_sysstat{stat_id="40002",@LABELS}[@INTERVAL])) by (@GBLABELS)

  ```sql
  select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40002) and (con_id > 1000 or con_id = 1) and class < 1000

  ```sql
  select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40002) and (con_id > 1000 or con_id = 1) and class < 1000

  ```

## replace

### 指标介绍

每秒处理 REPLACE 语句次数。

### 指标参数说明

| **指标项** | **指标名称** | **单位** |
| --- | --- | --- |
| replace | sql_replace_count | 次 |

### 计算表达式

sum(rate(ob_sysstat{stat_id="40004",@LABELS}[@INTERVAL])) by (@GBLABELS)

  ```sql
  select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40004) and (con_id > 1000 or con_id = 1) and class < 1000

  ```sql
  select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40004) and (con_id > 1000 or con_id = 1) and class < 1000

  ```

## update

### 指标介绍

每秒处理 UPDATE 语句次数。

### 指标参数说明

| **指标项** | **指标名称** | **单位** |
| --- | --- | --- |
| update | sql_update_count | 次 |

### 计算表达式

sum(rate(ob_sysstat{stat_id="40006",@LABELS}[@INTERVAL])) by (@GBLABELS)

  ```sql
  select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40006) and (con_id > 1000 or con_id = 1) and class < 1000

  ```sql
  select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40006) and (con_id > 1000 or con_id = 1) and class < 1000

  ```

## delete

### 指标介绍

每秒处理 DELETE 语句次数。

### 指标参数说明

| **指标项** | **指标名称** | **单位** |
| --- | --- | --- |
| delete | sql_delete_count | 次 |

### 计算表达式

sum(rate(ob_sysstat{stat_id="40008",@LABELS}[@INTERVAL])) by (@GBLABELS)

  ```sql
  select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40008) and (con_id > 1000 or con_id = 1) and class < 1000

  ```sql
  select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40008) and (con_id > 1000 or con_id = 1) and class < 1000

  ```

## other

### 指标介绍

每秒处理 DDL、DCL、DTL 等其他语句次数。

### 指标参数说明

| **指标项** | **指标名称** | **单位** |
| --- | --- | --- |
| other | sql_other_count | 次 |

### 计算表达式

sum(rate(ob_sysstat{stat_id="40018",@LABELS}[@INTERVAL])) by (@GBLABELS)

### 采集 SQL

- OceanBase V4.0 以下版本：

  ```sql
  select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40018) and (con_id > 1000 or con_id = 1) and class < 1000

  ```sql
  select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40018) and (con_id > 1000 or con_id = 1) and class < 1000

  ```

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
