All Products
Search
Document Center

AnalyticDB:Create a resource scaling plan

更新時間:Oct 24, 2024

AnalyticDB for MySQL allows you to use resource scaling plans to implement scheduled scaling of resources. You can use resource scaling plans in scenarios in which business workloads predictably fluctuate during peak and off-peak hours and computing resources or storage resources are insufficient. When business workloads increase, resource scaling plans take effect to add resources to ensure performance and stability. When business workloads decrease, resource scaling plans take effect to remove resources to reduce costs. Compared with manual scaling, resource scaling plans do not require data migration or affect data reads and writes. You can create resource scaling plans in the AnalyticDB for MySQL console or by calling API operations.

Prerequisites

  • If you use an AnalyticDB for MySQL Data Lakehouse Edition cluster, no limits are imposed on the cluster.

  • If you use an AnalyticDB for MySQL Data Warehouse Edition cluster, make sure that the following requirements are met:

    • The cluster is in elastic mode.

    • The cluster has 32 cores and 128 GB memory or higher specifications.

    • If the minor version of the cluster is 3.1.3.2 or later, the cluster supports Default Proportional Scaling for Computing Resources and EIUs scaling plans.

    • If the minor version of the cluster is 3.1.6.1 or later and the cluster is purchased at new prices, the cluster supports Scaling for Computing Resources and Scaling for EIUs scaling plans.

    Note

    For information about how to view and update the minor version of an AnalyticDB for MySQL Data Warehouse Edition cluster, see Update the minor version of a cluster.

Usage notes

  • When you scale a cluster, you cannot execute the SUBMIT JOB statement to submit asynchronous jobs. If your business requires asynchronous jobs, perform scaling during appropriate periods.

  • When the scaling process is about to end, transient connections may occur. We recommend that you scale your cluster during off-peak hours or make sure that your application is configured to automatically reconnect to your cluster.

  • When an AnalyticDB for MySQL cluster of the Data Warehouse Edition in elastic mode that runs in Standalone Edition performs scaling, the cluster is in the unavailable state. You cannot perform read, write, or control operations on the cluster. We recommend that you scale your cluster during off-peak hours and make sure that your application is configured to automatically reconnect to your cluster. You can use the cluster as expected after the scaling operation is complete.

Billing rules

You are charged for resources based on resource scaling plans on a pay-as-you-go basis. For more information, see Billable items of ACU elastic resources in Data Lakehouse Edition, Billable items of elastic computing resources in Data Warehouse Edition, and Billable items of elastic I/O resources in Data Warehouse Edition.

Types of resource scaling plans

Data Lakehouse Edition

AnalyticDB for MySQL Data Lakehouse Edition provides the following types of resource scaling plans:

  • Interactive Resource Group: scales only computing resources based on the desired specifications that are specified in the resource scaling plan. Resource scaling plans of this type are suitable for scenarios in which computing resources are insufficient.

  • Default Proportional Scaling for EIUs: scales storage resources based on the default proportion when an Interactive Resource Group scaling plan takes effect. Resource scaling plans of this type are suitable for scenarios in which resource requirements predictably fluctuate during peak and off-peak hours.

  • EIU: scales only storage resources based on the desired specifications that are specified in the resource scaling plan. Resource scaling plans of this type are suitable for scenarios in which storage resources are insufficient. For example, if you want to import large amounts of data every day for business intelligence (BI) report analysis, you can use this type of resource scaling plans.

Data Warehouse Edition

AnalyticDB for MySQL Data Warehouse Edition provides the following types of resource scaling plans:

  • Scaling for Computing Resources: scales out computing resources based on the original specifications. Resource scaling plans of this type are suitable for scenarios in which computing resources are insufficient.

  • Default Proportional Scaling for Computing Resources and EIUs: scales out computing resources based on the original specifications and scales up elastic I/O resources based on the same proportion as the computing resources. Resource scaling plans of this type are suitable for scenarios in which resource requirements predictably fluctuate during peak and off-peak hours.

  • Scaling for EIUs: scales up elastic I/O resources. Resource scaling plans of this type are suitable for scenarios in which storage resources are insufficient. For example, if you want to import large amounts of data every day for BI report analysis, you can use this type of scaling plans.

Create a resource scaling plan

Data Lakehouse Edition

Usage notes

  • You cannot change the configuration of a cluster when you use resource scaling plans. If you want to change the configuration of a cluster, you must first disable the resource scaling plans for the cluster. After you change the configuration of the cluster, you can re-enable the resource scaling plans for the cluster. For information about how to disable a resource scaling plan, see Manage a resource scaling plan.

  • You cannot enable an EIU scaling plan and a Default Proportional Scaling for EIUs scaling plan at the same time.

  • You cannot enable multiple Default Proportional Scaling for EIUs scaling plans at the same time.

  • If no Interactive Resource Group scaling plan is enabled, Default Proportional Scaling for EIUs scaling plans cannot take effect.

  • If the amount of reserved storage resources is 0 AnalyticDB compute units (ACUs), you can create only Interactive Resource Group scaling plans.

Procedure

  1. Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters. On the Data Lakehouse Edition tab, find the cluster that you want to manage and click the cluster ID.

  2. In the left-side navigation pane, choose Cluster Management > Resource Management.

  3. On the Resource Management page, click the Scaling Plans tab. On the Resource Scaling Plans tab, click Create Plan in the upper-right corner.

  4. In the Create Resource Scaling Plan panel, configure the parameters that are described in the following tables.

    1. Configure the Plan Name, Effective Date, and Expiration Date parameters.

      Parameter

      Description

      Plan Name

      The name of the resource scaling plan.

      Effective Date

      The date when the resource scaling plan takes effect.

      Expiration Date

      The date when the resource scaling plan expires. For example, if you set the Expiration Date to September 30, 2024, the resource scaling plan expires after 23:59:59 on September 30, 2024.

    2. Configure the Scaling Type parameter and relevant scaling plan parameters. For information about different types of resource scaling plans, see the "Types of resource scaling plans" section of this topic.

      Interactive Resource Group scaling plan

      Parameter

      Description

      Scaling Type

      The type of the resource scaling plan. Select Interactive Resource Group.

      Resource Group

      The interactive resource group that you want to use to scale computing resources.

      You can select only an interactive resource group for which the multi-cluster feature is disabled.

      Desired Specifications

      The specifications to which you want to scale computing resources.

      Scaling Cycle

      The days on which you want to execute the resource scaling plan.

      Scaling Time (Cluster-specific)

      The time when the computing resources of the interactive resource group are automatically scaled to the desired specifications.

      Important
      • If you want to execute an Interactive Resource Group scaling plan on the day when you create or modify the scaling plan, make sure that the following requirements are met:

        • If no Default Proportional Scaling for EIUs scaling plan is enabled, the interval between the scaling time and the current time must be greater than or equal to 10 minutes.

        • If a Default Proportional Scaling for EIUs scaling plan is enabled, the interval between the scaling time and the current time must be greater than or equal to 1 hour.

        For more information, see the "When does a resource scaling plan take effect?" section of this topic.

      • If you want to create multiple Interactive Resource Group scaling plans, make sure that the following requirements are met:

        • If a Default Proportional Scaling for EIUs scaling plan is enabled, the scaling time interval between multiple Interactive Resource Group scaling plans must be greater than or equal to 1 hour.

        • If no Default Proportional Scaling for EIUs scaling plan is enabled, the scaling time interval between multiple Interactive Resource Group scaling plans must be greater than or equal to 10 minutes.

      Enabled

      Specifies whether to enable the resource scaling plan. By default, the resource scaling plan is enabled.

      If you want to disable the resource scaling plan later, you can find the resource scaling plan on the Resource Scaling Plans tab and click Disable in the Actions column.

      EIU scaling plan

      Parameter

      Description

      Scaling Type

      The type of the resource scaling plan. Select EIU.

      Desired Specifications per EIU

      The specifications to which you want to scale the resources of each EIU.

      Scaling Cycle

      The days on which you want to execute the resource scaling plan.

      Scaling Time (Cluster-specific)

      The time when the resources of each EIU are automatically scaled to the desired specifications.

      Important
      • If you want to execute an EIU scaling plan on the day when you create or modify the scaling plan, make sure that the interval between the scaling time and the current time is greater than or equal to 1 hour.

      • The scaling time interval between multiple EIU scaling plans must be greater than or equal to 1 hour.

      Default Proportional Scaling for EIUs

      • Specifies whether to enable the Default Proportional Scaling for EIUs scaling plan. By default, the scaling plan is disabled, which specifies that EIU resources are separately scaled.

      • If you enable the Default Proportional Scaling for EIUs scaling plan, EIU resources are scaled based on the same proportion as the computing resources of the interactive resource group. To allow the Default Proportional Scaling for EIUs scaling plan to take effect, you must also create and enable an Interactive Resource Group scaling plan.

      Enabled

      Specifies whether to enable the resource scaling plan. By default, the resource scaling plan is enabled.

      If you want to disable the resource scaling plan later, you can find the resource scaling plan on the Resource Scaling Plans tab and click Disable in the Actions column.

  5. Click OK.

    The created resource scaling plan is displayed on the Resource Scaling Plans tab. You can view parameters of the resource scaling plan, such as Plan Name, Desired Specifications, Status, and Next Effective Time (Cluster-specific).

Data Warehouse Edition

Procedure

  1. Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters. On the Data Warehouse Edition tab, find the cluster that you want to manage and click the cluster ID.

  2. In the left-side navigation pane, click Elastic Resource Scaling.

  3. On the Resource Scaling Plans tab of the Elastic Resource Scaling page, click Create Plan.

  4. In the Create Resource Scaling Plan panel, configure the parameters that are described in the following tables.

    Parameter

    Description

    Scaling Type

    The type of the resource scaling plan. For information about different types of resource scaling plans, see the "Types of resource scaling plans" section of this topic.

    Plan Name

    The name of the resource scaling plan.

    Resource Group

    The interactive resource group that you want to use to scale resources.

    Effective Date

    The date when the resource scaling plan takes effect. The effective time varies based on the time when you create or modify the resource scaling plan. For more information, see the "When does a resource scaling plan take effect?" section of this topic.

    Expiration Date

    The date when the resource scaling plan expires.

    Scaling Time

    The time when the resources of the specified scaling plan type are automatically scaled to the desired specifications.

    Important

    If you want to execute multiple resource scaling plans on the same day, we recommend that you schedule the resource scaling plans at an interval of at least 1 hour.

    Restoration Time

    The time when you want the system to scale the resources back to the original specifications.

    Scaled Resources

    The specifications of the resources that you want to scale. The meaning of the Scaled Resources parameter varies based on the scaling plan type.

    • For the Scaling for Computing Resources scaling plan, the Scaled Resources parameter specifies the computing resources that you want to add based on the original specifications. For example, if the specifications of the computing resources are 32 cores and 128 GB and you set the Scaled Resources parameter to 16 cores and 64 GB, the computing resources are scaled to 48 cores and 192 GB.

    • For the Default Proportional Scaling for Computing Resources and EIUs scaling plan, the Scaled Resources parameter specifies the computing resources that you want to add based on the original specifications. The elastic I/O resources are scaled up based on the same scaling proportion as the computing resources. For example, if the specifications of the computing resources are 32 cores and 128 GB, the specifications of the elastic I/O resources are 8 cores and 64 GB, and you set the Scaled Resources parameter to 32 cores and 128 GB, the computing resources are scaled out to 64 cores and 256 GB at a scaling proportion of 2. In this case, the elastic I/O resources are scaled up to 16 cores and 128 GB based on the same scaling proportion.

      Important

      The scaling of elastic I/O resources is triggered only if you scale out computing resources to 1.5 times the current amount of computing resources. For example, when you scale out computing resources from 32 cores and 128 GB to 48 cores and 196 GB, elastic I/O resources are scaled up based on the proportion.

    • For the Scaling for EIUs scaling plan, the Scaled Resources parameter specifies the desired specifications of the elastic I/O resources. For example, if the specifications of the elastic I/O resources are 8 cores and 64 GB and you set the Scaled Resources parameter to 16 cores and 128 GB, the elastic I/O resources are scaled up to 16 cores and 128 GB.

    Scaling Cycle

    The days on which you want to execute the resource scaling plan.

    Enabled

    Specifies whether to enable the resource scaling plan. By default, the resource scaling plan is enabled.

  5. Click OK.

Configure alert rules for plan failures or latency

If resources are insufficient or an internal error occurs, scaling plans may be delayed or fail. In this case, you can log on to the CloudMonitor console and configure alert rules for the Instance:SystemMaintenance.Elastic:Delay and Instance:SystemMaintenance.Elastic:Failed events. This way, you can receive alert notifications when an error occurs, which allows you to resolve issues at the earliest opportunity. For more information, see Manage event subscription policies (recommended).

FAQ

When does a resource scaling plan take effect?

To allow resources to be immediately scaled to the desired specifications that are specified by a resource scaling plan, you must prepare resources in advance. After you create or modify a resource scaling plan, the resource scaling plan does not immediately take effect. The time when resource scaling plans take effect varies based on the cluster edition.

Data Lakehouse Edition

The effective time varies based on the scaling plan type.

  • If no Default Proportional Scaling for EIUs scaling plan is enabled, Interactive Resource Group scaling plans take effect 10 minutes after the scaling plans are created or modified.

  • If a Default Proportional Scaling for EIUs scaling plan is enabled, Interactive Resource Group scaling plans take effect 1 hour after the scaling plans are created or modified.

  • EIU scaling plans take effect 1 hour after the scaling plans are created or modified.

  • If no Interactive Resource Group scaling plan is enabled, Default Proportional Scaling for EIUs scaling plans do not take effect.

For example, the following parameters are configured for an Interactive Resource Group scaling plan:

  • Effective Date: 2024-09-18

  • Expiration Date: 2024-09-25

  • Scaling Time (Cluster-specific): 10:15:00

  • Scaling Cycle: every Wednesday

If a Default Proportional Scaling for EIUs scaling plan is enabled and the Interactive Resource Group scaling plan is created at 10:00:00 on September 18, 2024 (Wednesday), the Interactive Resource Group scaling plan takes effect at 11:00:00 on September 18, 2024 (Wednesday). When the scaling plan takes effect, 10:15:00 on September 18, 2024 (Wednesday) has passed. In this case, the first scaling operation is performed at 10:15:00 on September 25, 2024 (Wednesday). The Next Effective Time (Cluster-specific) parameter is displayed as 2024-09-25 10:15:00 in the AnalyticDB for MySQL console.

If no Default Proportional Scaling for EIUs scaling plan is enabled and the Interactive Resource Group scaling plan is created at 10:00:00 on September 18, 2024 (Wednesday), the Interactive Resource Group scaling plan takes effect at 10:10:00 on September 18, 2024 (Wednesday). The first scaling operation is performed at 10:15:00 on September 18, 2024 (Wednesday). The Next Effective Time (Cluster-specific) parameter is displayed as 2024-09-18 10:15:00 in the AnalyticDB for MySQL console.

Data Warehouse Edition

The following table describes the effective time of resource scaling plans.

Creation or modification time

Effective time

Example

00:00:00~23:00:00

00:00:00 on the next day. After a scaling plan takes effect, the scaling plan is executed at the specified time point.

The creation time of a scaling plan is 18:00:00 on September 24, 2024 (Tuesday). The following parameters are configured for the scaling plan:

  • Effective Date: 2024-09-24

  • Expiration Date: 2024-10-03

  • Scaling Time: 02:00:00

  • Scaling Cycle: every Wednesday

Effective time: The scaling plan takes effect at 00:00:00 on September 25, 2024 (Wednesday). The first scaling operation is performed at 02:00:00 on September 25, 2024 (Wednesday).

23:00:00~23:59:00

00:00:00 on the third day. After a scaling plan takes effect, the scaling plan is executed at the specified time point.

The creation time of a scaling plan is 23:30:00 on September 24, 2024 (Tuesday). The following parameters are configured for the scaling plan:

  • Effective Date: 2024-09-24

  • Expiration Date: 2024-10-03

  • Scaling Time: 02:00:00

  • Scaling Cycle: every Wednesday

Effective time: The scaling plan takes effect at 00:00:00 on September 26, 2024 (Thursday). The first scaling operation is performed at 02:00:00 on October 2, 2024 (Wednesday).

How do I schedule the scale-in and scale-out of resources for an AnalyticDB for MySQL Data Lakehouse Edition cluster?

You cannot use a single resource scaling plan of an AnalyticDB for MySQL Data Lakehouse Edition cluster to schedule the scale-in and scale-out of resources. To schedule the scale-in and scale-out of resources, you must create two resource scaling plans.

For example, you have a large number of query requests during the day and a small number of query requests during the night. You want to scale out resources at 06:00:00 every day and scale in resources at 23:00:00 every day. In this case, you can create two resource scaling plans. Example:

Data Lakehouse Edition

Category

Parameter

Scaling plan to scale out resources

Scaling Type: Interactive Resource Group

Desired Specifications: 32 ACUs

Scaling Cycle: Daily

Scaling Time (Cluster-specific): 06:00:00

Scaling plan to scale in resources

Scaling Type: Interactive Resource Group

Desired Specifications: 16 ACUs

Scaling Cycle: Daily

Scaling Time (Cluster-specific): 22:00:00

Related operations

Edition

Operation

Data Lakehouse Edition

CreateElasticPlan

Data Warehouse Edition

CreateElasticPlan