This topic describes the procedure and precautions for setting scheduled tenant scaling.
Background information
The resource demand of a tenant changes with the business load of the tenant. You can enable scheduled tenant scaling to dynamically adjust the quota of resources of a tenant, such as CPU and memory, to achieve efficient utilization of cluster resources in various business scenarios.
Enabling scheduled tenant scaling does not affect your business. However, to ensure business stability, we still recommend that you perform the operation in off-peak hours.
Precautions
A tenant can create only one scheduled scaling task, which is only responsible for the scheduled scaling of the tenant's CPU and memory. The tenant's log disk automatically scales out or in according to the size of the memory.
NoteIf the cluster instance is version 4.x, not only the CPU and memory of the tenant but also the log disk can be scaled regularly.
If you manually modify tenant resources after adding a scheduled scaling strategy, the scheduled scaling task will become invalid. You need to modify the strategy again to make the scheduled scaling task take effect.
Different tenants in the same cluster are independent of each other, and scaling management does not affect each other. The failure of a tenant's scaling task will not affect the execution of another tenant's scaling task.
If there are concurrent scheduled tenant scaling tasks in a cluster, they will be executed in sequence according to the following principles:
The priority of scaling-in tasks is higher than that of scaling-out tasks.
In scaling-in scenarios, the priority of scheduled tasks with a larger CPU release amount is higher; in scaling-out scenarios, the priority of scheduled tasks with a smaller CPU increase amount is higher.
You need to assess the cluster resource usage reasonably. Insufficient resources or unsupported cluster and tenant status may cause the scaling task to fail, and the scaling task does not support automatic retry.
NoteThe scheduled scaling task will be executed only when the cluster and the target tenant are both in the running state.
Prerequisites
A tenant has been created in the cluster instance. For more information, see Create a tenant.
The target tenant has not been set with a scheduled scaling strategy.
Add a scheduled scaling strategy
You can enable scheduled tenant scaling by using the following methods:
Method 1: Log on to the ApsaraDB for OceanBase console. Click Instances in the left-side navigation pane. Click the target instance to go to the Cluster Instance Workspace page. Click Resource Modification on the right of the Topology section and select Tenant Scheduled Scaling.
Method 2: Log on to the ApsaraDB for OceanBase console. Click Instances in the left-side navigation pane. Click the target instance to go to the Cluster Instance Workspace page. On the page that appears, click Tenant Management in the left-side navigation pane. In the upper-right corner of the Tenant Management page, click Tenant Scheduled Scaling.
The following procedure demonstrates how to use Method 1.
Log on to the ApsaraDB for OceanBase console.
In the left-side navigation pane, click Instances.
In the instance list, click the name of the target cluster instance to go to the Cluster Instance Workspace page.
Click Resource Modification on the right of the Topology section and select Tenant Scheduled Scaling.
On the Add Scheduled Scaling Strategy page, specify the strategy parameters.
Parameter
Description
Tenant
From the drop-down list, select a tenant that has not been set with a scheduled scaling strategy in the current cluster instance.
Target Specification
Set the CPU and memory specifications of the tenant's scheduled scaling strategy within the allocatable range.
The minimum tenant specification is 1C4GB.
The ratio of CPU to memory cannot be higher than 1:2.
Repeat Frequency
Set the execution cycle of the scheduled scaling strategy. Value range:
Once: The scheduled scaling strategy will perform the scaling operation only once at the set time point.
Every Day: During the effective date, the scheduled scaling strategy will perform the scaling operation once a day at the set time point.
Every Week: During the effective date, the scheduled scaling strategy will perform the scaling operation once a week at the set time point.
Every Month: During the effective date, the scheduled scaling strategy will perform the scaling operation once a month at the set time point.
Effective Date
Set the start and end time for the scheduled scaling strategy to take effect.
This parameter needs to be configured when Repeat Frequency is set to Every Day, Every Week, or Every Month.
Time to Start Scaling
The time to start the scaling task.
Restore to Original Specification
Whether to restore the original specification after a scheduled scaling task is executed once. Value range:
Yes: Restore to the original specification.
No: Do not restore to the original specification.
This parameter needs to be configured when Repeat Frequency is set to Once.
Time to Restore Original Specification
The time when the scaling task returns to the original specification.
NoteThe time interval between Time to Start Scaling and Time to Restore Original Specification must be at least 1 hour. Please set them reasonably according to the business situation.
Click OK.
View a scheduled scaling task
Log on to the ApsaraDB for OceanBase console.
In the left-side navigation pane, click Instances.
In the instance list, click the name of the target cluster instance to go to the Cluster Instance Workspace page.
Click Resource Modification on the right of the Topology section and select Tenant Scheduled Scaling.
You can enter the name or ID of a tenant to query the scheduled scaling tasks of the tenant.
You can click Edit or Delete in the row of a task to modify or delete the task.