このセクションでは、OceanBaseクラスタのパフォーマンス指標である QPS(Query Per Second)について説明します。QPS 指標は、クラスタが1秒間に処理するSQL文の数を集計するもので、処理されるSQL文のタイプに応じて以下のサブ指標に細分化されます:all、select、insert、replace、update、delete、other。統計範囲を指定することで、単一ゾーンまたはOBServerノード上のOceanBaseクラスタの QPS データを照会できます。
all
指標紹介
OceanBaseクラスタが1秒間に処理するSQL文の数。
指標パラメータ説明
指標項目 |
指標名 |
単位 |
|---|---|---|
| all | sql_all_count | times/s |
計算式
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 より前のバージョン:
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 < 1000OceanBase V4.0 以降のバージョン:
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
指標紹介
1秒間に処理されるSELECT文の数。
指標パラメータ説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| select | sql_select_count | times/s |
計算式
sum(rate(ob_sysstat{stat_id="40000",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V4.0 より前のバージョン:
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 < 1000OceanBase V4.0 以上のバージョン:
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
指標紹介
1秒間に処理されるINSERT文の数。
指標パラメータ説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| insert | sql_insert_count | times/s |
計算式
sum(rate(ob_sysstat{stat_id="40002",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V4.0 より前のバージョン:
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 < 1000OceanBase V4.0 以上のバージョン:
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
指標紹介
1秒間に処理されるREPLACE文の数。
指標パラメータ説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| replace | sql_replace_count | times/s |
計算式
sum(rate(ob_sysstat{stat_id="40004",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V4.0 より前のバージョン:
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 < 1000OceanBase V4.0 以降のバージョン:
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
指標紹介
1秒間に処理されるUPDATE文の数。
指標パラメータ説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| update | sql_update_count | times/s |
計算式
sum(rate(ob_sysstat{stat_id="40006",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V4.0 より前のバージョン:
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 < 1000OceanBase V4.0 以降のバージョン:
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
指標紹介
1秒間に処理されるDELETE文の数。
指標パラメータ説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| delete | sql_delete_count | times/s |
計算式
sum(rate(ob_sysstat{stat_id="40008",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V4.0 より前のバージョン:
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 < 1000OceanBase V4.0 以上のバージョン:
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
指標の紹介
1秒間に処理されるDDL、DCL、DTLなどその他のステートメントの回数。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| other | sql_other_count | times/s |
計算式
sum(rate(ob_sysstat{stat_id="40018",@LABELS}[@INTERVAL])) by (@GBLABELS)
収集SQL
OceanBase V4.0 より前のバージョン:
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 < 1000OceanBase V4.0 以上のバージョン:
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
commit
1秒間に処理されるCommitステートメントの数。
指標パラメータの説明
指標項目 |
指標名 |
単位 |
|---|---|---|
| commit | sql_commit_count | times/s |
計算式
sum(rate(ob_sysstat{stat_id="40025",@LABELS}[@INTERVAL])) by (@GBLABELS)
取得SQL
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40025) and (con_id > 1000 or con_id = 1) and con_id in (select tenant_id from DBA_OB_TENANTS WHERE tenant_type<>'META')
rollback
1秒間に処理されるRollbackステートメントの数。
指標パラメータ説明
指標項目 |
指標名 |
単位 |
|---|---|---|
| rollback | sql_rollback_count | times/s |
計算式
sum(rate(ob_sysstat{stat_id="40027",@LABELS}[@INTERVAL])) by (@GBLABELS)
取得SQL
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40027) and (con_id > 1000 or con_id = 1) and con_id in (select tenant_id from DBA_OB_TENANTS WHERE tenant_type<>'META')