You can increase or decrease the CPU, memory, and log disk capacities in a unit config.
Considerations
To increase the capacities of a unit config corresponding to resource units that are being used by a tenant, make sure that each node has sufficient free resources. You can query the oceanbase.GV$OB_SERVERS view for the total resources and allocated resources on each node to determine whether a unit config can be modified.
To increase the capacities of a unit config, make sure that the capacities after the increase meet the following requirements:
Sum(min_cpu) <= CPU_CAPACITY;
Sum(max_cpu) <= CPU_CAPACITY * resource_hard_limit;
Sum(memory_size) <= MEM_CAPACITY;
Sum(log_disk_size) <= LOG_DISK_CAPACITY;
where:
CPU_CAPACITYindicates the total CPU capacity on a single node.MEM_CAPACITYindicates the total memory capacity on a single node.LOG_DISK_CAPACITYindicates the total log disk capacity on a single node.The total capacity of the log disk is jointly controlled by the cluster-level parameters
log_disk_sizeandlog_disk_percentage. Thelog_disk_sizeparameter specifies the size of the log disk space for storing REDO logs, and its default value is0. Thelog_disk_percentageparameter specifies the percentage of the log disk space for storing REDO logs, and its default value is0. Rules for using the two parameters are as follows:If the value of
log_disk_sizeis0Mand that oflog_disk_percentageis not0, the system allocates the space of the log disk based on the value oflog_disk_percentage.If the value of
log_disk_sizeis not0M, the system allocates the space of the log disk based on the value oflog_disk_sizeregardless of whether the value oflog_disk_percentageis0.If the value of
log_disk_sizeis0Mand that oflog_disk_percentageis0, the system calculates the percentage of the disk space occupied by REDO logs based on whether logs and data are stored on the same disk.If the disk is shared, the percentage of the disk space occupied by REDO logs is 30%.
If the disk is exclusive for REDO logs, the percentage of the disk space occupied by REDO logs is 90%.
For more information about the
log_disk_sizeparameter, see log_disk_size.For more information about the
log_disk_percentageparameter, see log_disk_percentage.resource_hard_limitindicates a specific system parameter.The system allocates CPU resources based on the value of the
resource_hard_limitparameter. The value range is[100, 10000]. The default value is100, indicating that overprovisioning is not allowed.For more information about the
resource_hard_limitparameter, see resource_hard_limit.
Before you downgrade a unit config, make sure that the total CPU, memory, and log disk capacity after the downgrade is greater than or equal to the current size of used space of the log disk.
Limitations
You can modify a unit config only in the sys tenant.
Procedure
You can modify the CPU, memory, input/output operations per second (IOPS), and log disk capacities of a unit config. If you do not specify a new value for an item, the original value of the item takes effect.
Log on to the
systenant of the cluster as therootuser.Modify a unit config.
Here is a sample statement:
ALTER RESOURCE UNIT unitname MAX_CPU [=] cpunum, [MIN_CPU [=] cpunum,] MEMORY_SIZE [=] memsize, [MAX_IOPS [=] iopsnum, MIN_IOPS [=] iopsnum,IOPS_WEIGHT [=]iopsweight,] [LOG_DISK_SIZE [=] logdisksize];Execute the following statement to modify the configurations of the
unit1resource unit:obclient> ALTER RESOURCE UNIT unit1 MAX_CPU 15, MEMORY_SIZE '20G', LOG_DISK_SIZE '4G';