Check cluster resource usage in OCP
Note
The GUI of OceanBase Cloud Platform (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 cluster in OCP, perform the following steps:
Log on to the OCP console. The Cluster Overview page appears.
In the Clusters list on the Cluster Overview page, find the required cluster 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. We recommend that you set the threshold to be no more than 80% for CPU resources and be no more than 90% for memory resources. 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 cluster resource usage by executing SQL statements
Log on to the sys tenant and execute the following SQL statement to query the resource usage of a cluster. Statement and sample result:
ob-sys 10.0.0.0 (root@oceanbase)> SELECT t1.svr_ip, t1.svr_port, t1.zone, t2.with_rootserver, t1.cpu_total, t1.cpu_assigned cpu_ass, t1.cpu_assigned_percent cpu_ass_pct, round(t1.mem_total/1024/1024/1024,1) "mem_total(G)", round(t1.mem_assigned/1024/1024/1024,1) "mem_ass(G)", t1.mem_assigned_percent mem_ass_pct, t1.unit_num FROM __all_virtual_server_stat t1 JOIN __all_server t2 ON (t1.svr_ip=t2.svr_ip) ORDER BY zone;
+----------+----------+-------+-----------------+-----------+---------+-------------+--------------+------------+-------------+----------+
| svr_ip | svr_port | zone | with_rootserver | cpu_total | cpu_ass | cpu_ass_pct | mem_total(G) | mem_ass(G) | mem_ass_pct | unit_num |
+----------+----------+-------+-----------------+-----------+---------+-------------+--------------+------------+-------------+----------+
| 10.0.0.0 | 7702 | zone1 | 1 | 22 | 8.5 | 38 | 25.1 | 21.3 | 84 | 3 |
| 10.0.0.0 | 7702 | zone2 | 0 | 22 | 8.5 | 38 | 25.1 | 21.3 | 84 | 3 |
| 10.0.0.0 | 7702 | zone3 | 0 | 22 | 8.5 | 38 | 25.1 | 21.3 | 84 | 3 |
+---------------+----------+-------+-----------------+-----------+---------+-------------+--------------+------------+-------------+----------+
3 rows in set (0.02 sec)
The following table describes the parameters in the SQL statements.
| Parameter | Description |
|---|---|
| svr_ip | The IP address of the OBServer node. |
| svr_port | The process port number. |
| zone | The zone to which the OBServer node belongs. |
| with_rootserver |
|
| cpu_total | The total amount of CPU resources of the OBServer node. |
| cpu_ass | The amount of allocated CPU resources of the OBServer node. |
| cpu_ass_pct | The ratio of the allocated CPU resources to the total CPU resources of the OBServer node. |
| mem_total | The total memory size of the OBServer node. |
| mem_ass | The allocated memory size of the OBServer node. |
| mem_ass_pct:observer | The ratio of the allocated memory size to the total memory size of the OBServer node. |
| unit_num | The number of resource units of the OBServer node. |