You can modify the CPU, memory, and log disk configurations of a resource unit.
Considerations
If you want to upgrade the configurations of a resource unit that is being used by a tenant, make sure that the OBServer node has sufficient resources for allocation. You can query the oceanbase.GV$OB_SERVERS view for the total resources and allocated resources of the node and determine whether the configurations of the resource unit can be modified based on calculation.
To upgrade the configurations of a resource unit, make sure that the total amounts of resources after the modification 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;
Parameters:
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. The rules for using the two parameters are described in the following list:If the value of
log_disk_sizeis0but the value oflog_disk_percentageis not0, the system allocates log disk space based on the value oflog_disk_percentage.If the value of
log_disk_sizeis not0, the system allocates log disk space based on the value oflog_disk_size, regardless of whether the value oflog_disk_percentageis0.If the values of both
log_disk_sizeandlog_disk_percentageare0, the system automatically calculates the percentage of the disk space occupied by REDO logs. The percentage depends on whether the disk is shared by REDO logs and data.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. Value range: [1,10000]. The default value is100, indicating that over-allocation is not allowed.For more information about the
resource_hard_limitparameter, see resource_hard_limit.
To downgrade the configurations of a resource unit, make sure that the total amounts of resources including the CPU, memory, and log disk capacity are greater than or equal to the used resources of the disk.
Limitations
Only the sys tenant can modify resource unit configurations.
Procedure
You can modify one or more of the CPU, memory, IOPS, and log disk configurations of a resource unit. The configurations that are not modified remain unchanged.
Log on to the
systenant of the cluster as therootuser.Modify the configurations of a resource unit.
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];Modify the configurations of the
unit1resource unit.obclient> ALTER RESOURCE UNIT unit1 MAX_CPU 15, MEMORY_SIZE '20G', LOG_DISK_SIZE '4G';