This topic describes how to view information about tenants and resources through views.
Tenant resources
Resources in a database are divided into two major categories: logical resources and physical resources. Logical resources refer to entities corresponding to logical concepts, including data structures, threads, locks, and sessions. Physical resources refer to hardware resources, including CPU, disk, and memory. The amount of logical resources a tenant can create is limited by physical resources; a logical resource may be constrained by one or more physical resources.
Logical resources
The following table describes the logical resources in OceanBase Database.
Resource Name |
Description |
|---|---|
| LS | A log stream is the basic unit for transaction commit. The number of log streams a tenant can create on each node is determined by the hidden parameter (_max_ls_cnt_per_server), tenant memory (MAX(8, (MEMORY_SIZE - 4G) / 200MB + 8)), and the size of the log disk. Specifically:
|
| TABLET | A data tablet, which is the basic unit for data migration. The maximum number of tablets a tenant can create on each node is determined by the parameter configuration and the tenant's memory size. The formula is (MEMORY_SIZE/1GB) * _max_tablet_cnt_per_gb and (MEMORY_SIZE * _storage_meta_memory_limit_percentage) / 200MB * 20000. Wherein:
|
| SESSION | The maximum number of connections a tenant can create on each node is defined by the hidden parameter_resource_limit_max_session_numor tenant memory ((MEMORY_SIZE * 5%) / 100KB) to determine.Among them, the tenant-level hidden parameter _resource_limit_max_session_numSpecifies the maximum number of concurrent connections for regular users within a user tenant. The value range is [0,1000000]. The default value is 0, which indicates no configuration. In this case, the system internally determines the number based on(MEMORY_SIZE * 5%) / 100KBThe maximum number of connections is calculated as follows: when_resource_limit_max_session_numWhen the value of this parameter is greater than 0, the value set by the hidden parameter takes effect. This configuration takes effect immediately after modification without requiring a restart of the OBServer node. |
| THREAD | Threads. The maximum number of threads per node is defined by the hidden parameter_ob_max_thread_numCluster-level hidden parameter. _ob_max_thread_numSpecifies the maximum number of threads for each node. The value range is [0, 10000). The default value is 0, which means no upper limit is set. This parameter can only be modified by the sys tenant and takes effect immediately after modification without requiring a restart of the OBServer node. |
| TX_PARTICIPANT | Transaction participants: When a transaction modifies the data of a log stream, that log stream becomes a participant in the transaction and generates a participant data structure. Participants in active transactions are called active participants. The maximum number of active participants on a node is 700,000. |
Physical resources
The following table describes the physical resources in OceanBase Database.
Resource Name |
Description |
|---|---|
| DATA_DISK | Data disk: the disk used to store user business data. Currently, all tenants share the data disk. |
| CLOG_DISK | Log disk: the disk used to store tenant clogs. |
| CPU | CPU: The computing resources available to a tenant. |
| MEMORY | Memory: The total memory available for the tenant. |
| MEMSTORE | Business data memory: the business data memory available for a tenant. |
Related views
OceanBase Database provides views related to tenant and resource information. You can query relevant information through these views in the system tenant oceanbase.
DBA_OB_UNIT_CONFIGS: Displays all unit config information, including unit config ID, name, resource config, etc.DBA_OB_RESOURCE_POOLS: Displays all resource pool information, including resource pool ID, name, bound tenant, zone list, etc.DBA_OB_TENANTS: Displays the configuration information of all tenants, including tenant ID, name, type, resources, etc.GV$OB_UNITS: Displays the unit information of a node, including node IP, port, unit config ID, tenant ID, resource config, etc.GV$OB_SERVERS: Displays the resource allocation information of a node, including node IP, port, belonging zone, resource usage, etc.GV$OB_TENANT_RESOURCE_LIMIT: Displays the logical resource usage, upper limit, effective constraint conditions, and maximum resource usage after a crash and restart of a tenant on each unit.GV$OB_TENANT_RESOURCE_LIMIT.Detail: Displays the constraints on a tenant's logical resources and the upper limits for each constraint.
View all unit config information
You can view all unit config information through the DBA_OB_UNIT_CONFIGS view. Example:
Taking the second row of the query result as an example, the unit config name (NAME) is config_mysql001_zone1_S1_okz, the unit config ID (UNIT_CONFIG_ID) is 1001, the creation time (CREATE_TIME) is 2022-12-20 18:04:31, the maximum CPU specification (MAX_CPU) is 1.5C, the memory specification (MEMORY_SIZE) is 6G, and the log disk space (LOG_DISK_SIZE) is 18G.
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_UNIT_CONFIGS;
The query result is as follows:
+----------------+-------------------------------+----------------------------+----------------------------+---------+---------+-------------+---------------+----------+----------+-------------+---------------------+----------------------+
| UNIT_CONFIG_ID | NAME | CREATE_TIME | MODIFY_TIME | MAX_CPU | MIN_CPU | MEMORY_SIZE | LOG_DISK_SIZE | MAX_IOPS | MIN_IOPS | IOPS_WEIGHT | MAX_NET_BANDWIDTH | NET_BANDWIDTH_WEIGHT |
+----------------+-------------------------------+----------------------------+----------------------------+---------+---------+-------------+---------------+----------+----------+-------------+---------------------+----------------------+
| 1 | sys_unit_config | 2022-12-20 17:50:17.035504 | 2022-12-20 17:50:17.035504 | 1 | 1 | 14495514624 | 14495514624 | 10000 | 10000 | 1 | 9223372036854775807 | 4 |
| 1001 | config_mysql001_zone1_S1_okz | 2022-12-20 18:04:31.547715 | 2022-12-20 18:04:31.547715 | 1.5 | 1.5 | 6442450944 | 19327352832 | 15000 | 15000 | 1 | 9223372036854775807 | 2 |
| 1002 | config_mysql001_zone2_S1_pme | 2022-12-20 18:04:31.561335 | 2022-12-20 18:04:31.561335 | 1.5 | 1.5 | 6442450944 | 19327352832 | 15000 | 15000 | 1 | 9223372036854775807 | 2 |
| 1003 | config_mysql001_zone3_S1_jsu | 2022-12-20 18:04:31.564510 | 2022-12-20 18:04:31.564510 | 1.5 | 1.5 | 6442450944 | 19327352832 | 15000 | 15000 | 1 | 9223372036854775807 | 2 |
| 1013 | config_oracle001_zone3_S1_exu | 2022-12-26 18:28:37.969047 | 2022-12-26 18:28:37.969047 | 1.5 | 1.5 | 6442450944 | 19327352832 | 15000 | 15000 | 1 | 9223372036854775807 | 2 |
| 1014 | config_oracle001_zone2_S1_hli | 2022-12-26 18:28:37.972194 | 2022-12-26 18:28:37.972194 | 1.5 | 1.5 | 6442450944 | 19327352832 | 15000 | 15000 | 1 | 9223372036854775807 | 2 |
| 1015 | config_oracle001_zone1_S1_owy | 2022-12-26 18:28:37.976446 | 2022-12-26 18:28:37.976446 | 1.5 | 1.5 | 6442450944 | 19327352832 | 15000 | 15000 | 1 | 9223372036854775807 | 2 |
+----------------+-------------------------------+----------------------------+----------------------------+---------+---------+-------------+---------------+----------+----------+-------------+---------------------+----------------------+
7 rows in set
For detailed descriptions of the parameters in the DBA_OB_UNIT_CONFIGS view, see DBA_OB_UNIT_CONFIGS.
View all resource pool information
You can view all resource pool information through the DBA_OB_RESOURCE_POOLS view. Example:
Taking the second row of the query result as an example, the resource pool name (NAME) is pool_mysql001_zone3_jsu, the resource pool ID (RESOURCE_POOL_ID) is 1001, the bound tenant ID (TENANT_ID) is 1002, the used unit config ID (UNIT_CONFIG_ID) is 1003, the number of resource pool units (UNIT_COUNT) is 1, and the used zone list (ZONE_LIST) is zone3.
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_RESOURCE_POOLS;
The query result is as follows:
+------------------+--------------------------+-----------+----------------------------+----------------------------+------------+----------------+-------------------+--------------+
| RESOURCE_POOL_ID | NAME | TENANT_ID | CREATE_TIME | MODIFY_TIME | UNIT_COUNT | UNIT_CONFIG_ID | ZONE_LIST | REPLICA_TYPE |
+------------------+--------------------------+-----------+----------------------------+----------------------------+------------+----------------+-------------------+--------------+
| 1 | sys_pool | 1 | 2022-12-20 17:50:17.038641 | 2022-12-20 17:50:17.045453 | 1 | 1 | zone1;zone2;zone3 | FULL |
| 1001 | pool_mysql001_zone3_jsu | 1002 | 2022-12-20 18:04:31.607227 | 2022-12-20 18:04:31.692836 | 1 | 1003 | zone3 | FULL |
| 1002 | pool_mysql001_zone1_okz | 1002 | 2022-12-20 18:04:31.617087 | 2022-12-20 18:04:31.691827 | 1 | 1001 | zone1 | FULL |
| 1003 | pool_mysql001_zone2_pme | 1002 | 2022-12-20 18:04:31.621327 | 2022-12-20 18:04:31.692836 | 1 | 1002 | zone2 | FULL |
| 1013 | pool_oracle001_zone3_exu | 1010 | 2022-12-26 18:28:37.979539 | 2022-12-26 18:28:38.059505 | 1 | 1013 | zone3 | FULL |
| 1014 | pool_oracle001_zone1_owy | 1010 | 2022-12-26 18:28:37.988964 | 2022-12-26 18:28:38.058440 | 1 | 1015 | zone1 | FULL |
| 1015 | pool_oracle001_zone2_hli | 1010 | 2022-12-26 18:28:37.994241 | 2022-12-26 18:28:38.059505 | 1 | 1014 | zone2 | FULL |
+------------------+--------------------------+-----------+----------------------------+----------------------------+------------+----------------+-------------------+--------------+
7 rows in set
For more information about the parameters of the DBA_OB_RESOURCE_POOLS view, see DBA_OB_RESOURCE_POOLS.
View information of all tenants
You can view information of all tenants through the DBA_OB_TENANTS view. Example:
Take the third row of the query result as an example. The tenant name (TENANT_NAME) is mysql001, the tenant ID (TENANT_ID) is 1002, the tenant type (TENANT_TYPE) is a user tenant, the tenant creation time (CREATE_TIME) is 2025-12-29 15:44:48, the tenant's PRIMARY_ZONE (PRIMARY_ZONE) is zone1 (high priority) and zone2, the tenant replica distribution (LOCALITY) is in zone1, zone2, and zone3, and the compatibility mode (COMPATIBILITY_MODE) is MySQL.
obclient(root@sys)[oceanbase]> SELECT TENANT_ID, TENANT_NAME, TENANT_TYPE, CREATE_TIME, PRIMARY_ZONE, LOCALITY, COMPATIBILITY_MODE, STATUS FROM oceanbase.DBA_OB_TENANTS;
The query result is as follows:
+-----------+-------------+-------------+----------------------------+--------------+----------------------------------------------+--------------------+--------+
| TENANT_ID | TENANT_NAME | TENANT_TYPE | CREATE_TIME | PRIMARY_ZONE | LOCALITY | COMPATIBILITY_MODE | STATUS |
+-----------+-------------+-------------+----------------------------+--------------+----------------------------------------------+--------------------+--------+
| 1 | sys | SYS | 2025-12-29 15:43:42.930290 | RANDOM | FULL{1}@zone1 | MYSQL | NORMAL |
| 1001 | META$1002 | META | 2025-12-29 15:44:48.700796 | zone1;zone2 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | MYSQL | NORMAL |
| 1002 | mysql001 | USER | 2025-12-29 15:44:48.704354 | zone1;zone2 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | MYSQL | NORMAL |
| 1003 | META$1004 | META | 2025-12-29 15:50:35.033311 | zone1 | FULL{1}@zone1 | MYSQL | NORMAL |
| 1004 | oracle001 | USER | 2025-12-29 15:50:35.034367 | zone1 | FULL{1}@zone1 | ORACLE | NORMAL |
+-----------+-------------+-------------+----------------------------+--------------+----------------------------------------------+--------------------+--------+
5 rows in set
For more information about the parameters of the DBA_OB_TENANTS view, see DBA_OB_TENANTS.
View tenant resource configurations
Execute the following statement to query tenant resource configuration information across multiple views.
Take the query result for tenant mysql001 as an example. In the pool:conf column, you can see the names of the three resource pools and the resource specifications used by this tenant. In the unit_info column, you can see that the number of units in the resource pool is 1, with a corresponding CPU configuration of 1.5C and memory configuration of 6G.
obclient(root@sys)[oceanbase]> SELECT c.TENANT_ID, e.TENANT_NAME, concat(c.NAME, ': ', d.NAME) `pool:conf`,concat(c.UNIT_COUNT, ' unit: ', d.min_cpu, 'C/', ROUND(d.MEMORY_SIZE/1024/1024/1024,0), "G") unit_info
FROM DBA_OB_RESOURCE_POOLS c, DBA_OB_UNIT_CONFIGS d, DBA_OB_TENANTS e
WHERE c.UNIT_CONFIG_ID=d.UNIT_CONFIG_ID AND c.TENANT_ID=e.TENANT_ID AND c.TENANT_ID>1000
ORDER BY c.TENANT_ID;
The query result is as follows:
+-----------+-------------+---------------------------------------------------------+-----------------+
| TENANT_ID | TENANT_NAME | pool:conf | unit_info |
+-----------+-------------+---------------------------------------------------------+-----------------+
| 1002 | mysql001 | pool_mysql001_zone1_okz: config_mysql001_zone1_S1_okz | 1 unit: 1.5C/6G |
| 1002 | mysql001 | pool_mysql001_zone2_pme: config_mysql001_zone2_S1_pme | 1 unit: 1.5C/6G |
| 1002 | mysql001 | pool_mysql001_zone3_jsu: config_mysql001_zone3_S1_jsu | 1 unit: 1.5C/6G |
| 1010 | oracle001 | pool_oracle001_zone3_exu: config_oracle001_zone3_S1_exu | 1 unit: 1.5C/6G |
| 1010 | oracle001 | pool_oracle001_zone2_hli: config_oracle001_zone2_S1_hli | 1 unit: 1.5C/6G |
| 1010 | oracle001 | pool_oracle001_zone1_owy: config_oracle001_zone1_S1_owy | 1 unit: 1.5C/6G |
+-----------+-------------+---------------------------------------------------------+-----------------+
6 rows in set
View the deployment locations of tenant resource units
Execute the following statement to view the device IP addresses where the resource units of the currently created tenant are located.
In the query result, you can see the ID corresponding to each tenant and the IP address of the node where the resources are located.
obclient(root@sys)[oceanbase]> SELECT a.TENANT_NAME,a.TENANT_ID,b.SVR_IP FROM DBA_OB_TENANTS a,GV$OB_UNITS b WHERE a.TENANT_ID=b.TENANT_ID;
The query result is as follows:
+-------------+-----------+----------------+
| TENANT_NAME | TENANT_ID | SVR_IP |
+-------------+-----------+----------------+
| sys | 1 | xx.xx.xx.237 |
| META$1002 | 1001 | xx.xx.xx.237 |
| mysql001 | 1002 | xx.xx.xx.237 |
| META$1010 | 1009 | xx.xx.xx.237 |
| oracle001 | 1010 | xx.xx.xx.237 |
| sys | 1 | xx.xx.xx.238 |
| META$1002 | 1001 | xx.xx.xx.238 |
| mysql001 | 1002 | xx.xx.xx.238 |
| META$1010 | 1009 | xx.xx.xx.238 |
| oracle001 | 1010 | xx.xx.xx.238 |
| sys | 1 | xx.xx.xx.218 |
| META$1002 | 1001 | xx.xx.xx.218 |
| mysql001 | 1002 | xx.xx.xx.218 |
| META$1010 | 1009 | xx.xx.xx.218 |
| oracle001 | 1010 | xx.xx.xx.218 |
+-------------+-----------+----------------+
15 rows in set
View unit information of a node
You can view the unit information of all nodes through the GV$OB_UNITS view. Example:
- Taking the third row of the query result as an example, the node IP address (SVR_IP) is
xx.xx.xx.218, the server port number (SVR_PORT) is 2882, the unit ID (UNIT_ID) is 1001, the tenant ID (TENANT_ID) is 1002, the corresponding zone name (ZONE) is zone3, the maximum CPU specification (MAX_CPU) is 1.5C, the memory size (MEMORY_SIZE) is 5G, the log disk size (LOG_DISK_SIZE) is 16G, the used log disk space (LOG_DISK_IN_USE) is 1.07G, the used data disk space (DATA_DISK_IN_USE) is 572M, and the unit status (STATUS) is normal. - Considering the five rows where SVR_IP is xx.xx.xx.218 together, it indicates that this node has five units, belonging to tenants with TENANT_IDs 1, 1001, 1002, 1009, and 1010 respectively.
- Considering the three rows where TENANT_ID is 1002 together, it indicates that this tenant has one unit on each of the three nodes, with UNIT IDs 1001, 1002, and 1003.
obclient(root@sys)[oceanbase]> SELECT * FROM GV$OB_UNITS;
The query result is as follows:
+----------------+----------+---------+-----------+-------+-----------+----------------+---------+---------+-------------+----------+----------+-------------+---------------+-----------------+------------------+--------+----------------------------+--------------+
| SVR_IP | SVR_PORT | UNIT_ID | TENANT_ID | ZONE | ZONE_TYPE | REGION | MAX_CPU | MIN_CPU | MEMORY_SIZE | MAX_IOPS | MIN_IOPS | IOPS_WEIGHT | LOG_DISK_SIZE | LOG_DISK_IN_USE | DATA_DISK_IN_USE | STATUS | CREATE_TIME | REPLICA_TYPE |
+----------------+----------+---------+-----------+-------+-----------+----------------+---------+---------+-------------+----------+----------+-------------+---------------+-----------------+------------------+--------+----------------------------+--------------+
| xx.xx.xx.218 | 2882 | 3 | 1 | zone3 | ReadWrite | default_region | 1 | 1 | 14495514624 | 10000 | 10000 | 1 | 14495514624 | 11566462821 | 6069157888 | NORMAL | 2022-12-20 17:49:25.705363 | FULL |
| xx.xx.xx.218 | 2882 | 1001 | 1001 | zone3 | ReadWrite | default_region | NULL | NULL | 1073741824 | NULL | NULL | NULL | 1932735283 | 1520602567 | 7325351936 | NORMAL | 2022-12-20 18:04:31.693819 | FULL |
| xx.xx.xx.218 | 2882 | 1001 | 1002 | zone3 | ReadWrite | default_region | 1.5 | 1.5 | 5368709120 | 15000 | 15000 | 1 | 17394617549 | 1154755905 | 599785472 | NORMAL | 2022-12-20 18:04:31.693819 | FULL |
| xx.xx.xx.218 | 2882 | 1013 | 1009 | zone3 | ReadWrite | default_region | NULL | NULL | 1073741824 | NULL | NULL | NULL | 1932735283 | 1495227415 | 5368709120 | NORMAL | 2022-12-26 18:28:38.060661 | FULL |
| xx.xx.xx.218 | 2882 | 1013 | 1010 | zone3 | ReadWrite | default_region | 1.5 | 1.5 | 5368709120 | 15000 | 15000 | 1 | 17394617549 | 3532346784 | 681574400 | NORMAL | 2022-12-26 18:28:38.060661 | FULL |
| xx.xx.xx.237 | 2882 | 1 | 1 | zone1 | ReadWrite | default_region | 1 | 1 | 14495514624 | 10000 | 10000 | 1 | 14495514624 | 11566525317 | 6071255040 | NORMAL | 2022-12-20 17:49:25.705315 | FULL |
| xx.xx.xx.237 | 2882 | 1002 | 1001 | zone1 | ReadWrite | default_region | NULL | NULL | 1073741824 | NULL | NULL | NULL | 1932735283 | 1520680069 | 7325351936 | NORMAL | 2022-12-20 18:04:31.692599 | FULL |
| xx.xx.xx.237 | 2882 | 1002 | 1002 | zone1 | ReadWrite | default_region | 1.5 | 1.5 | 5368709120 | 15000 | 15000 | 1 | 17394617549 | 4845753295 | 595591168 | NORMAL | 2022-12-20 18:04:31.692599 | FULL |
| xx.xx.xx.237 | 2882 | 1014 | 1009 | zone1 | ReadWrite | default_region | NULL | NULL | 1073741824 | NULL | NULL | NULL | 1932735283 | 1495304058 | 5391777792 | NORMAL | 2022-12-26 18:28:38.059317 | FULL |
| xx.xx.xx.237 | 2882 | 1014 | 1010 | zone1 | ReadWrite | default_region | 1.5 | 1.5 | 5368709120 | 15000 | 15000 | 1 | 17394617549 | 3532357328 | 681574400 | NORMAL | 2022-12-26 18:28:38.059317 | FULL |
| xx.xx.xx.238 | 2882 | 2 | 1 | zone2 | ReadWrite | default_region | 1 | 1 | 14495514624 | 10000 | 10000 | 1 | 14495514624 | 11566567057 | 5947523072 | NORMAL | 2022-12-20 17:49:25.705354 | FULL |
| xx.xx.xx.238 | 2882 | 1003 | 1001 | zone2 | ReadWrite | default_region | NULL | NULL | 1073741824 | NULL | NULL | NULL | 1932735283 | 1520720157 | 7337934848 | NORMAL | 2022-12-20 18:04:31.693277 | FULL |
| xx.xx.xx.238 | 2882 | 1003 | 1002 | zone2 | ReadWrite | default_region | 1.5 | 1.5 | 5368709120 | 15000 | 15000 | 1 | 17394617549 | 4845759221 | 591396864 | NORMAL | 2022-12-20 18:04:31.693277 | FULL |
| xx.xx.xx.238 | 2882 | 1015 | 1009 | zone2 | ReadWrite | default_region | NULL | NULL | 1073741824 | NULL | NULL | NULL | 1932735283 | 1495346552 | 5364514816 | NORMAL | 2022-12-26 18:28:38.060042 | FULL |
| xx.xx.xx.238 | 2882 | 1015 | 1010 | zone2 | ReadWrite | default_region | 1.5 | 1.5 | 5368709120 | 15000 | 15000 | 1 | 17394617549 | 3532362696 | 681574400 | NORMAL | 2022-12-26 18:28:38.060042 | FULL |
+----------------+----------+---------+-----------+-------+-----------+----------------+---------+---------+-------------+----------+----------+-------------+---------------+-----------------+------------------+--------+----------------------------+--------------+
15 rows in set
For detailed descriptions of the parameters in the GV$OB_UNITS view, see GV$OB_UNITS.
View node resource allocation information
You can use the GV$OB_SERVERS view to view OBServer information. Example:
Taking the first row of the query result as an example, the node IP address (SVR_IP) is xx.xx.xx.238, the server port number (SVR_PORT) is 2882, the corresponding zone name (zone) is zone2, the SQL port (SQL_PORT) is 2881, the number of CPUs available to the observer process (CPU_CAPACITY) is 64C, the memory available to the observer process (MEM_CAPACITY) is 54G, the allocated memory (MEM_ASSIGNED) is 27.5G, the total log disk capacity (LOG_DISK_CAPACITY) is 167.25G, the allocated log disk space (LOG_DISK_ASSIGNED) is 55G, the used log disk space (LOG_DISK_IN_USE) is 22G, the data disk capacity (DATA_DISK_CAPACITY) is 167.25G, and the used data disk space (DATA_DISK_IN_USE) is 18.89G.
obclient(root@sys)[oceanbase]> SELECT * FROM GV$OB_SERVERS;
The query result is as follows:
+----------------+----------+-------+----------+--------------+------------------+--------------+------------------+--------------+--------------+-------------------+-------------------+-----------------+--------------------+------------------+-------------------------+--------------+-------------------------+-----------------------+----------------------------------+-----------------------------+
| SVR_IP | SVR_PORT | ZONE | SQL_PORT | CPU_CAPACITY | CPU_CAPACITY_MAX | CPU_ASSIGNED | CPU_ASSIGNED_MAX | MEM_CAPACITY | MEM_ASSIGNED | LOG_DISK_CAPACITY | LOG_DISK_ASSIGNED | LOG_DISK_IN_USE | DATA_DISK_CAPACITY | DATA_DISK_IN_USE | DATA_DISK_HEALTH_STATUS | MEMORY_LIMIT | DATA_DISK_ABNORMAL_TIME | SSL_CERT_EXPIRED_TIME | SS_DATA_DISK_OPERATION_SUGGESTED | SS_DATA_DISK_SIZE_SUGGESTED |
+----------------+----------+-------+----------+--------------+------------------+--------------+------------------+--------------+--------------+-------------------+-------------------+-----------------+--------------------+------------------+-------------------------+--------------+-------------------------+-----------------------+----------------------------------+-----------------------------+
| xx.xx.xx.238 | 2882 | zone2 | 2881 | 64 | 64 | 5 | 5 | 57982058496 | 29527900160 | 179583320064 | 59592671232 | 23622320128 | 179593805824 | 20283654144 | NORMAL | 68719476736 | NULL | NULL | NULL | NULL |
| xx.xx.xx.237 | 2882 | zone1 | 2881 | 64 | 64 | 5 | 5 | 32212254720 | 29527900160 | 179583320064 | 59592671232 | 23622320128 | 179593805824 | 20443037696 | NORMAL | 85899345920 | NULL | NULL | NULL | NULL |
| xx.xx.xx.218 | 2882 | zone3 | 2881 | 64 | 64 | 4 | 4 | 57982058496 | 27380416512 | 179583320064 | 53150220288 | 19528679424 | 179593805824 | 20044578816 | NORMAL | 68719476736 | NULL | NULL | NULL | NULL |
+----------------+----------+-------+----------+--------------+------------------+--------------+------------------+--------------+--------------+-------------------+-------------------+-----------------+--------------------+------------------+-------------------------+--------------+-------------------------+-----------------------+----------------------------------+-----------------------------+
3 rows in set
For detailed descriptions of the parameters in the GV$OB_SERVERS view, see GV$OB_SERVERS.
View real-time I/O statistics for resource groups of a tenant
In the sys tenant, you can query the GV$OB_GROUP_IO_STAT view to view the real-time IOPS and bandwidth statistics for each resource group on all OBServer nodes. Example:
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.GV$OB_GROUP_IO_STAT WHERE TENANT_ID=1002 LIMIT 5;
The query result is as follows:
+-----------+----------------+----------+----------+-------------------+-------+----------+----------+-----------+-----------+-------------------+---------------------------+--------------------+----------------------------+
| TENANT_ID | SVR_IP | SVR_PORT | GROUP_ID | GROUP_NAME | MODE | MIN_IOPS | MAX_IOPS | NORM_IOPS | REAL_IOPS | MAX_NET_BANDWIDTH | MAX_NET_BANDWIDTH_DISPLAY | REAL_NET_BANDWIDTH | REAL_NET_BANDWIDTH_DISPLAY |
+-----------+----------------+----------+----------+-------------------+-------+----------+----------+-----------+-----------+-------------------+---------------------------+--------------------+----------------------------+
| 1002 | 172.xx.xxx.198 | 2882 | 0 | OTHER_GROUP | READ | 307 | 20000 | 0 | 0 | 50000000 | 47.684MB/s | 0 | 0B/s |
| 1002 | 172.xx.xxx.198 | 2882 | 0 | OTHER_GROUP | WRITE | 307 | 20000 | 0 | 0 | 50000000 | 47.684MB/s | 0 | 0B/s |
| 1002 | 172.xx.xxx.198 | 2882 | 10000 | interactive_group | READ | 307 | 18000 | 0 | 0 | 50000000 | 47.684MB/s | 0 | 0B/s |
| 1002 | 172.xx.xxx.198 | 2882 | 10000 | interactive_group | WRITE | 307 | 18000 | 0 | 0 | 50000000 | 47.684MB/s | 0 | 0B/s |
| 1002 | 172.xx.xxx.198 | 2882 | 10001 | batch_group | READ | 409 | 16000 | 0 | 0 | 50000000 | 47.684MB/s | 0 | 0B/s |
+-----------+----------------+----------+----------+-------------------+-------+----------+----------+-----------+-----------+-------------------+---------------------------+--------------------+----------------------------+
5 rows in set
In the query result, OTHER_GROUP is a system-defined resource group, and interactive_group and batch_group are user-defined resource groups. If no resource group is bound when configuring a resource management plan, the system-defined resource group OTHER_GROUP is used by default.
From the third row of the result, you can see that for tenant 1002 on node 172.xx.xxx.198, the minimum IOPS for read operations in the interactive_group resource group is 307, the maximum IOPS is 1800, the current actual IOPS is 0, the configured maximum network bandwidth is 47.684 MB/s, and the current network bandwidth is 0 B/s.
View real-time I/O statistics for function-level background tasks of a tenant
In the sys tenant, you can query the GV$OB_FUNCTION_IO_STAT view to view the I/O statistics at the function level on all OBServer nodes. Example:
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.GV$OB_FUNCTION_IO_STAT WHERE TENANT_ID=1002 LIMIT 5;
The query result is as follows:
+----------------+----------+-----------+------------------+--------------+------+-----------+-----------+-------------+-------------+----------+
| SVR_IP | SVR_PORT | TENANT_ID | FUNCTION_NAME | MODE | SIZE | REAL_IOPS | REAL_MBPS | SCHEDULE_US | IO_DELAY_US | TOTAL_US |
+----------------+----------+-----------+------------------+--------------+------+-----------+-----------+-------------+-------------+----------+
| 172.xx.xxx.198 | 2882 | 1002 | DEFAULT_FUNCTION | LOCAL READ | 0 | 0 | 0 | 0 | 0 | 0 |
| 172.xx.xxx.198 | 2882 | 1002 | DEFAULT_FUNCTION | LOCAL WRITE | 4096 | 2 | 0 | 20 | 142 | 178 |
| 172.xx.xxx.198 | 2882 | 1002 | DEFAULT_FUNCTION | REMOTE READ | 0 | 0 | 0 | 20 | 142 | 178 |
| 172.xx.xxx.198 | 2882 | 1002 | DEFAULT_FUNCTION | REMOTE WRITE | 0 | 0 | 0 | 20 | 142 | 178 |
| 172.xx.xxx.198 | 2882 | 1002 | COMPACTION_HIGH | LOCAL READ | 0 | 0 | 0 | 20 | 142 | 178 |
+----------------+----------+-----------+------------------+--------------+------+-----------+-----------+-------------+-------------+----------+
5 rows in set
In the query result, COMPACTION_HIGH defines tasks such as Mini Merge and DDL KV Merge, and DEFAULT_FUNCTION defines all background tasks other than those already defined.
From the fifth row of the result, you can see that for tenant 1002 on node 172.xx.xxx.198, the average I/O size (SIZE) for local reads of tasks such as Mini Merge and DDL KV Merge (COMPACTION_HIGH) is 0, the actual IOPS (REAL_IOPS) is 0, the actual bandwidth used (REAL_MBPS) is 0 MB/s, the average time consumed by I/O scheduling (SCHEDULE_US) is 20 μs, the average execution time for disk I/O (IO_DELAY_US) is 142 μs, and the overall average execution time for I/O (TOTAL_US) is 178 μs.
View the logical resource usage and limits of a tenant
In the sys tenant, you can query the GV$OB_TENANT_RESOURCE_LIMIT view to view the logical resource usage of a tenant per unit. Example:
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.GV$OB_TENANT_RESOURCE_LIMIT WHERE TENANT_ID=1004;
The query result is as follows:
+----------------+----------+-----------+-------+---------------+---------------------+-----------------+----------------+-------------+----------------------+
| SVR_IP | SVR_PORT | TENANT_ID | ZONE | RESOURCE_NAME | CURRENT_UTILIZATION | MAX_UTILIZATION | RESERVED_VALUE | LIMIT_VALUE | EFFECTIVE_LIMIT_TYPE |
+----------------+----------+-----------+-------+---------------+---------------------+-----------------+----------------+-------------+----------------------+
| 172.xx.xxx.xxx | 2882 | 1004 | zone1 | ls | 2 | 2 | 0 | 13 | memory |
| 172.xx.xxx.xxx | 2882 | 1004 | zone1 | tablet | 656 | 656 | 0 | 100000 | configuration |
+----------------+----------+-----------+-------+---------------+---------------------+-----------------+----------------+-------------+----------------------+
2 rows in set
From the first row of the result, you can see that for tenant 1004 on node 172.xx.xxx.xxx:2882, there are currently 2 log streams (CURRENT_UTILIZATION), a maximum of 2 log streams have ever existed simultaneously (MAX_UTILIZATION), and a maximum of 13 log streams can be created (LIMIT_VALUE). The upper limit for these 13 log streams is calculated based on the tenant's memory (memory).
From the second row of the result, you can see that for tenant 1004 on node 172.xx.xxx.xxx:2882, there are currently 656 TABLETs (CURRENT_UTILIZATION), a maximum of 656 TABLETs have ever existed simultaneously (MAX_UTILIZATION), and a maximum of 100,000 TABLETs can be created (LIMIT_VALUE). The upper limit for these 100,000 TABLETs is calculated based on the tenant's memory (configuration).
Since the logical resources that a tenant can create on each node are subject to various physical resources or parameter value limitations, you can query the GV$OB_TENANT_RESOURCE_LIMIT_DETAIL view to further view the specific limitations and upper limits for the tenant's logical resources.
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.GV$OB_TENANT_RESOURCE_LIMIT_DETAIL WHERE TENANT_ID=1004;
The query result is as follows:
+----------------+----------+-----------+---------------+---------------+---------------------+
| SVR_IP | SVR_PORT | TENANT_ID | RESOURCE_NAME | LIMIT_TYPE | LIMIT_VALUE |
+----------------+----------+-----------+---------------+---------------+---------------------+
| 172.xx.xxx.xxx | 2882 | 1004 | ls | configuration | 90 |
| 172.xx.xxx.xxx | 2882 | 1004 | ls | memstore | 9223372036854775807 |
| 172.xx.xxx.xxx | 2882 | 1004 | ls | memory | 13 |
| 172.xx.xxx.xxx | 2882 | 1004 | ls | data_disk | 9223372036854775807 |
| 172.xx.xxx.xxx | 2882 | 1004 | ls | clog_disk | 32 |
| 172.xx.xxx.xxx | 2882 | 1004 | ls | cpu | 9223372036854775807 |
| 172.xx.xxx.xxx | 2882 | 1004 | tablet | configuration | 100000 |
| 172.xx.xxx.xxx | 2882 | 1004 | tablet | memstore | 9223372036854775807 |
| 172.xx.xxx.xxx | 2882 | 1004 | tablet | memory | 102400 |
| 172.xx.xxx.xxx | 2882 | 1004 | tablet | data_disk | 9223372036854775807 |
| 172.xx.xxx.xxx | 2882 | 1004 | tablet | clog_disk | 9223372036854775807 |
| 172.xx.xxx.xxx | 2882 | 1004 | tablet | cpu | 9223372036854775807 |
+----------------+----------+-----------+---------------+---------------+---------------------+
12 rows in set
The query results show that tenant 1004 is on the 172.xx.xxx.xxx:2882 node. The factors that limit the number of log streams that can be created are as follows (9223372036854775807 indicates no limit):
The configuration parameter (
configuration) limits the number of log streams that can be created to 90.Tenant memory (
memory) limits the number of log streams that can be created to 13.Log disk (
clog_disk) limits the number of log streams that can be created to 32.
