You can increase or decrease the sizes of resource items, such as the CPU, memory, and log disk capacity, in a unit config.
Considerations
If the unit config to be modified is being used by a tenant and resources are to be increased, make sure that the OBServer node involved has sufficient resources for allocation. You can query the oceanbase.GV$OB_SERVERS view for the total resources and allocated resources of the OBServer node to confirm whether the unit config can be modified.
Before you upgrade the unit config, make sure that the resources after the upgrade can 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;
Take note of the following parameter description:
CPU_CAPACITY: the total CPU capacity.MEM_CAPACITY: the total memory capacity.LOG_DISK_CAPACITY: the total capacity of the log disk.The total capacity of the log disk is jointly controlled by the
log_disk_sizeandlog_disk_percentageparameters.log_disk_sizespecifies the size of the disk where REDO logs are stored, and the default value is0.log_disk_percentagespecifies the percentage of the disk space occupied by REDO logs, and the 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_limit: a specific system parameter.The system allocates CPU resources based on the value of the
resource_hard_limitparameter. The value range is [0, 10000]. The default value is100, indicating that over-allocation 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
Only the sys tenant can modify a unit config.
Procedure
You can modify the CPU capacity, memory capacity, input/output operations per second (IOPS), and log disk capacity. 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.
The syntax is as follows:
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';