This topic describes how to view tenant and resource information by using views.
Tenant resources
Resources in a database are classified into logical resources and physical resources. Logical resources are entities that correspond to logical concepts, such as data structures, threads, locks, and sessions. Physical resources are hardware resources, such as CPU, disk, and memory. The quantity of logical resources that a tenant can create is limited by physical resources. In addition, a logical resource may be limited by one or more physical resources.
Logical resources
The following table describes the logical resources in OceanBase Database.
Resource |
Description |
|---|---|
| LS | Log stream, the basic commit unit of transactions. The number of log streams that a tenant can create on each node is determined by the hidden parameter (_max_ls_cnt_per_server), the tenant's memory (MAX(8, (MEMORY_SIZE - 4G) / 200MB + 8)), and the size of the log disk.
|
| TABLET | Data shard, the basic unit of data migration. The maximum number of tablets that a tenant can create on each node is determined by the configuration parameters and the tenant's memory. The formula for calculating the maximum number of tablets is (MEMORY_SIZE/1GB) * _max_tablet_cnt_per_gb and (MEMORY_SIZE * _storage_meta_memory_limit_percentage) / 200MB * 20000.
|
| SESSION | Session, the maximum number of connections that a tenant can create on each node is determined by the hidden parameter _resource_limit_max_session_num or the tenant's memory ((MEMORY_SIZE * 5%) / 100KB). The tenant-level hidden parameter _resource_limit_max_session_num specifies the maximum number of concurrent connections allowed for a normal user in the tenant. The value range is [0,1000000]. The default value is 0, which means no configuration. In this case, the system calculates the maximum number of connections based on (MEMORY_SIZE * 5%) / 100KB. If _resource_limit_max_session_num is greater than 0, the specified value takes effect. This configuration parameter takes effect immediately upon modification, without the need to restart the OBServer node. |
| THREAD | Thread, the maximum number of threads on each node is determined by the hidden parameter _ob_max_thread_num. The cluster-level hidden parameter _ob_max_thread_num specifies the maximum number of threads on each node. The value range is [0,10000). The default value is 0, which means no upper limit. This configuration parameter can be modified only by the sys tenant. It takes effect immediately upon modification, without the need to restart the OBServer node. |
Physical resources
The following table describes the physical resources in OceanBase Database.
Resource |
Description |
|---|---|
| DATA_DISK | A disk for storing user business data. All tenants share one data disk. |
| CLOG_DISK | A disk for storing clogs of tenants. |
| CPU | The computing resources available to a tenant. |
| MEMORY | The total memory available to a tenant. |
| MEMSTORE | The memory available for storing business data. |
Views
OceanBase Database provides views for querying tenant and resource information. You can query the information in these views in the sys tenant of OceanBase Database.
DBA_OB_UNIT_CONFIGS: displays the configurations of all resources, including resource ID, name, and specifications.DBA_OB_RESOURCE_POOLS: displays the configurations of all resource pools, including pool ID, name, tenant binding status, and zone list.DBA_OB_TENANTS: displays the configurations of all tenants, including tenant ID, name, type, and resources.GV$OB_UNITS: displays the unit information of a node, including IP address, port number, resource specification ID, tenant ID, and configuration.GV$OB_SERVERS: displays the resource distribution of a node, including IP address, port number, zone to which the node belongs, and resource usage.GV$OB_TENANT_RESOURCE_LIMIT: displays the logical resource usage, limits, effective constraints, and maximum resource consumption after a tenant is restarted on each unit.
View all resource specifications
You can query the DBA_OB_UNIT_CONFIGS view for all resource specifications. Here is an example:
Take the data in the second row of the query result as an example. The resource specification (UNIT_CONFIG_ID) is config_mysql001_zone1_S1_okz, the resource specification 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.5 cores, the memory specification (MEMORY_SIZE) is 6 GB, and the log disk space (LOG_DISK_SIZE) is 18 GB.
obclient [oceanbase]> SELECT * FROM DBA_OB_UNIT_CONFIGS;
+----------------+-------------------------------+----------------------------+----------------------------+---------+---------+-------------+---------------+----------+----------+-------------+
| UNIT_CONFIG_ID | NAME | CREATE_TIME | MODIFY_TIME | MAX_CPU | MIN_CPU | MEMORY_SIZE | LOG_DISK_SIZE | MAX_IOPS | MIN_IOPS | IOPS_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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
+----------------+-------------------------------+----------------------------+----------------------------+---------+---------+-------------+---------------+----------+----------+-------------+
7 rows in set
For more information about the parameters in the DBA_OB_UNIT_CONFIGS view, see DBA_OB_UNIT_CONFIGS.
Query information about all resource pools
You can query the DBA_OB_RESOURCE_POOLS view for information about all resource pools. Here is an example:
Take the data in the second row of the query result as an example. The resource pool name (RESOURCE_POOL_ID) is pool_mysql001_zone3_jsu, the resource pool ID (RESOURCE_POOL_ID) is 1001, the tenant ID (TENANT_ID) to which the resource pool belongs is 1002, the unit config ID (UNIT_CONFIG_ID) used by the resource pool is 1003, and the number of units (UNIT_COUNT) in the resource pool is 1. The zone list (ZONE_LIST) used by the resource pool is zone3.
obclient [oceanbase]> SELECT * FROM DBA_OB_RESOURCE_POOLS;
+------------------+--------------------------+-----------+----------------------------+----------------------------+------------+----------------+-------------------+--------------+
| 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 in the DBA_OB_RESOURCE_POOLS view, see DBA_OB_RESOURCE_POOLS.
Query information about all tenants
You can query the DBA_OB_TENANTS view for information about all tenants. Here is an example:
In this example, the third row of the query result shows that the tenant name (TENANT_NAME) is mysql001, the tenant ID (TENANT_ID) is 1002, the tenant type (TENANT_TYPE) is user tenant, the tenant creation time (CREATE_TIME) is 2023-05-17 18:15:21, the primary zone (PRIMARY_ZONE) of the tenant is zone1 (high priority) and zone2, and the localities of the tenant's replicas are zone1, zone2, and zone3. The compatibility mode (COMPATIBILITY_MODE) of the tenant is MySQL.
obclient [oceanbase]> SELECT * FROM DBA_OB_TENANTS;
+-----------+-------------+-------------+----------------------------+----------------------------+--------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+
| TENANT_ID | TENANT_NAME | TENANT_TYPE | CREATE_TIME | MODIFY_TIME | PRIMARY_ZONE | LOCALITY | PREVIOUS_LOCALITY | COMPATIBILITY_MODE | STATUS | IN_RECYCLEBIN | LOCKED | TENANT_ROLE | SWITCHOVER_STATUS | SWITCHOVER_EPOCH | SYNC_SCN | REPLAYABLE_SCN | READABLE_SCN | RECOVERY_UNTIL_SCN | LOG_MODE | ARBITRATION_SERVICE_STATUS |
+-----------+-------------+-------------+----------------------------+----------------------------+--------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+
| 1 | sys | SYS | 2023-05-17 18:10:19.940353 | 2023-05-17 18:10:19.940353 | RANDOM | FULL{1}@zone1 | NULL | MYSQL | NORMAL | NO | NO | PRIMARY | NORMAL | 0 | NULL | NULL | NULL | NULL | NOARCHIVELOG | DISABLED |
| 1001 | META$1002 | META | 2023-05-17 18:15:21.455549 | 2023-05-17 18:15:36.639479 | zone1;zone2 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | NULL | MYSQL | NORMAL | NO | NO | PRIMARY | NORMAL | 0 | NULL | NULL | NULL | NULL | NOARCHIVELOG | DISABLED |
| 1002 | mysql001 | USER | 2023-05-17 18:15:21.461276 | 2023-05-17 18:15:36.669988 | zone1;zone2 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | NULL | MYSQL | NORMAL | NO | NO | PRIMARY | NORMAL | 0 | 1684395321137516636 | 1684395321137516636 | 1684395321052204807 | 4611686018427387903 | NOARCHIVELOG | DISABLED |
| 1003 | META$1004 | META | 2023-05-17 18:18:19.927859 | 2023-05-17 18:18:36.443233 | zone1 | FULL{1}@zone1 | NULL | MYSQL | NORMAL | NO | NO | PRIMARY | NORMAL | 0 | NULL | NULL | NULL | NULL | NOARCHIVELOG | DISABLED |
| 1004 | oracle001 | USER | 2023-05-17 18:18:19.928914 | 2023-05-17 18:18:36.471606 | zone1 | FULL{1}@zone1 | NULL | ORACLE | NORMAL | NO | NO | PRIMARY | NORMAL | 0 | 1684395321137558760 | 1684395321137558760 | 1684395320951813345 | 4611686018427387903 | NOARCHIVELOG | DISABLED |
+-----------+-------------+-------------+----------------------------+----------------------------+--------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+
5 rows in set
For more information about the parameters of the DBA_OB_TENANTS view, see DBA_OB_TENANTS.
Query the resource configurations of a tenant
Execute the following statement to query the resource configurations of a tenant in multiple views.
Take the query result of the mysql001 tenant as an example. The pool:conf column shows the names of three resource pools and the specifications of resources used by the tenant. The unit_info column shows that the tenant has one unit in the first resource pool, which is configured with 1.5 CPU cores and 6 GB of memory, and that the second resource pool has one unit configured with 1 CPU core and 6 GB of memory.
obclient [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;
+-----------+-------------+---------------------------------------------------------+-----------------+
| 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
Query the deployment location of resources of a tenant
Run the following command to view the IP address of the device where the resources of the current tenant are deployed.
In the query result, you can find the ID of each tenant and the IP address of the node where the resources of the tenant are located.
obclient [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;
+-------------+-----------+----------------+
| 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
Query the unit information of a node
You can query the unit information of all nodes by using the GV$OB_UNITS view. Here is an example:
- Take the third row in the query result as an example. The IP address (SVR_IP) of the node 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 zone name (ZONE) is zone3, the maximum CPU core count (MAX_CPU) is 1.5, the memory size (MEMORY_SIZE) is 5 GB, the log disk size (LOG_DISK_SIZE) is 16 GB, the size of the log disk already used (LOG_DISK_IN_USE) is 1.07 GB, the size of the data disk already used (DATA_DISK_IN_USE) is 572 MB, and the unit status (STATUS) is normal. - Consider the five rows with the same SVR_IP address, xx.xx.xx.218. These rows indicate that the node has five units, which belong to the tenants with the IDs of 1, 1001, 1002, 1009, and 1010 respectively.
- Consider the three rows with the same TENANT_ID, 1002. These rows indicate that the tenant has one unit on each of three nodes, and the unit IDs are 1001, 1002, and 1003 respectively.
obclient [oceanbase]> SELECT * FROM GV$OB_UNITS;
+----------------+----------+---------+-----------+-------+-----------+----------------+---------+---------+-------------+----------+----------+-------------+---------------+-----------------+------------------+--------+----------------------------+
| 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 |
+----------------+----------+---------+-----------+-------+-----------+----------------+---------+---------+-------------+----------+----------+-------------+---------------+-----------------+------------------+--------+----------------------------+
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
+----------------+----------+---------+-----------+-------+-----------+----------------+---------+---------+-------------+----------+----------+-------------+---------------+-----------------+------------------+--------+----------------------------+
15 rows in set
For more information about the parameters in the GV$OB_UNITS view, see GV$OB_UNITS.
View the resource allocation information of a node
You can query the GV$OB_SERVERS view for the information about an OBServer node. Here is an example:
Take the first row of the query result as an example. The IP address (SVR_IP) of the node is xx.xx.xx.238, the server port number (SVR_PORT) is 2882, the zone name (zone) is zone2, the SQL port number (SQL_PORT) is 2881, the observer process has 64 CPU cores (CPU_CAPACITY), 54 GB of memory (MEM_CAPACITY), 27.5 GB of memory has been allocated (MEM_ASSIGNED), 167.25 GB of space is available on the log disk (LOG_DISK_CAPACITY), 55 GB of space has been allocated on the log disk (LOG_DISK_ASSIGNED), 22 GB of space is used on the log disk (LOG_DISK_IN_USE), 167.25 GB of space is available on the data disk (DATA_DISK_CAPACITY), and 18.89 GB of space is used on the data disk (DATA_DISK_IN_USE).
obclient [oceanbase]> SELECT * FROM GV$OB_SERVERS;
+----------------+----------+-------+----------+--------------+------------------+--------------+------------------+--------------+--------------+-------------------+-------------------+-----------------+--------------------+------------------+-------------------------+--------------+-------------------------+-----------------------+
| 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 |
+----------------+----------+-------+----------+--------------+------------------+--------------+------------------+--------------+--------------+-------------------+-------------------+-----------------+--------------------+------------------+-------------------------+--------------+-------------------------+-----------------------+
| xx.xx.xx.238 | 2882 | zone2 | 2881 | 64 | 64 | 5 | 5 | 57982058496 | 29527900160 | 179583320064 | 59592671232 | 23622320128 | 179593805824 | 20283654144 | NORMAL | 68719476736 | NULL | NULL |
| xx.xx.xx.237 | 2882 | zone1 | 2881 | 64 | 64 | 5 | 5 | 32212254720 | 29527900160 | 179583320064 | 59592671232 | 23622320128 | 179593805824 | 20443037696 | NORMAL | 85899345920 | NULL | NULL |
| xx.xx.xx.218 | 2882 | zone3 | 2881 | 64 | 64 | 4 | 4 | 57982058496 | 27380416512 | 179583320064 | 53150220288 | 19528679424 | 179593805824 | 20044578816 | NORMAL | 68719476736 | NULL | NULL |
+----------------+----------+-------+----------+--------------+------------------+--------------+------------------+--------------+--------------+-------------------+-------------------+-----------------+--------------------+------------------+-------------------------+--------------+-------------------------+-----------------------+
3 rows in set
View the usage and limits of a tenant's logical resources
In the sys tenant, you can query the GV$OB_TENANT_RESOURCE_LIMIT view to view the usage of logical resources on each unit of a tenant. Here is an example:
obclient [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
As shown in the first row of the result, tenant 1004 has two log streams (CURRENT_UTILIZATION) on the node 172.xx.xxx.xxx:2882 at present, with a maximum of two log streams concurrently existing (MAX_UTILIZATION), and a maximum of 13 log streams allowed (LIMIT_VALUE). The upper limit of the 13 log streams is determined by the tenant memory (memory).
As shown in the second row of the result, tenant 1004 has 656 tablets (CURRENT_UTILIZATION) on the node 172.xx.xxx.xxx:2882 at present, with a maximum of 656 tablets concurrently existing (MAX_UTILIZATION), and a maximum of 100,000 tablets allowed (LIMIT_VALUE). The upper limit of the 100,000 tablets is determined by the tenant memory (configuration).
The tenant can create logical resources on each node subject to various physical resources or configuration values. You can query the GV$OB_TENANT_RESOURCE_LIMIT_DETAIL view for more information about the specific limits on the tenant's logical resources and the upper limits of the various limits.
obclient [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
As shown in the query result, the following factors limit the number of log streams that can be created by tenant 1004 on the node 172.xx.xxx.xxx:2882 (9223372036854775807 indicates no limit):
The configuration value limits the number of log streams to 90.
The tenant memory limits the number of log streams to 13.
The clog disk limits the number of log streams to 32.
