You can check tenant resource usage by using OceanBase Cloud Platform (OCP) or SQL statements.
Check tenant resource usage in OCP
Note
The GUI of OCP may vary with the version. This topic takes OCP V3.1.1 as an example. For OCP of other versions, see User Guide of the corresponding version.
To check the resource usage of a tenant in OCP, perform the following steps:
Log on to the OCP console. In the left-side navigation pane, click Tenants.
In the Tenants list on the Tenant Overview page, find the target tenant and click its name.
In the left-side navigation pane of the page that appears, click Resource Management.
The following table describes the elements and parameters on the Resource Management page.
Element/Parameter Description Condition Range - You can select Database from the first drop-down list for data filtering. In this case, you can specify a specific database, table, or partition. After you specify the filter conditions, click Search. Then, you can view information in the Resource Usage Tendency and Rankings sections.
- You can also select Table Groups for filtering. In this case, you can select all table groups or a specific table group, all tables or a specific table, and all partitions or a specific partition. After you specify the filter conditions, click Search.
Resource Usage Tendency You can view trend charts in the Disks, Replicas, CPU, and Memory sections. Disks and Replicas The Disks and Replicas trend charts display the trend of resource usage. CPU and Memory The CPU and Memory trend charts display the trend of resource allocation. Filter icon or Zone3/Zone2/Zone1 icon You can click the filter icon or the Zone3/Zone2/Zone1 icon of each trend chart to view the resource usage for different zones.
Check tenant resource usage by executing SQL statements
You can execute the following SQL statements to view the resource usage of a tenant. Statements and sample result:
obclient> SELECT t1.tenant_name,concat(svr_ip,":",svr_port) as "unit_server",t3.max_cpu,t3.min_cpu,round(t3.max_memory/1024/1024/1024,1) as "max_memory(G)" ,round(t3.min_memory/1024/1024/1024,1) as "min_memory(G)" FROM __all_tenant t1,__all_unit t2,__all_unit_config t3,__all_resource_pool t4
where t1.tenant_id = t4.tenant_id
AND t4.resource_pool_id=t2.resource_pool_id
AND t4.unit_config_id=t3.unit_config_id
ORDER BY t1.tenant_name
+---------------+----------------+---------+---------+---------------+---------------+
| tenant_name | unit_server | max_cpu | min_cpu | max_memory(G) | min_memory(G) |
+---------------+----------------+---------+---------+---------------+---------------+
| sys | 10.0.0.0:7702 | 5 | 2.5 | 7.5 | 6.3 |
| tenant_mysql | 10.0.0.0:7702 | 2 | 2 | 5.0 | 5.0 |
| tenant_oracle | 10.0.0.0:7702 | 4 | 4 | 10.0 | 10.0 |
+---------------+--------------------+---------+---------+---------------+---------------+
The following table describes the parameters in the SQL statements.
| Parameter | Description |
|---|---|
| tenant_name | The tenant name. |
| unit_server | The OBServer node to which the resource units of the tenant belong. |
| max_cpu | The maximum number of CPU cores available for the resource units of the tenant. |
| min_cpu | The minimum number of CPU cores available for the resource units of the tenant. |
| max_memory | The maximum memory size available for the resource units of the tenant. |
| min_memory | The minimum memory size available for the resource units of the tenant. |