All Products
Search
Document Center

AnalyticDB:Multi-cluster scaling models

Last Updated:Oct 17, 2024

Interactive resource groups support multi-cluster scaling models. A multi-cluster scaling model consists of one or more compute clusters and allows AnalyticDB for MySQL to automatically scale resources based on query loads to meet resource isolation and high concurrency requirements for resource groups.

Prerequisites

  • An AnalyticDB for MySQL Data Lakehouse Edition cluster is created.

  • The minor version of the AnalyticDB for MySQL cluster is 3.1.10.0 or later.

    Note

    To query the minor version of an AnalyticDB for MySQL Data Lakehouse Edition cluster, execute the SELECT adb_version(); statement. To update the minor version of a cluster, contact technical support.

What is a multi-cluster resource group?

If the multi-cluster feature is disabled, only a single compute cluster executes queries in a resource group. After you submit queries to the resource group, the queries share all computing resources of the resource group. If a large number of queries are executed in the resource group, resource contention occurs and the query response slows down. When the number of concurrent queries in the resource group reaches the upper limit, the queries are queued.

A multi-cluster resource group consists of one or more compute clusters. You can apply for cluster resources from the resource group to handle the changing query loads in a static or dynamic manner. Access nodes receive user queries and use load balancing to allocate the queries to different compute clusters in the resource group for execution. The compute clusters can independently execute queries without affecting each other. The following figure shows how a multi-cluster resource group executes queries.image.png

Multi-cluster resource groups can improve the concurrency of small and medium-sized queries and eliminate resource contention. However, multi-cluster resource groups cannot accelerate slow queries or extract, transform, load (ETL) jobs.

Advantages

For a resource group for which the multi-cluster feature is disabled, you must perform the following operations if the query loads increase to the point in which you require additional computing resources to meet your business requirements:

  • Manually adjust the amount of computing resources available for the resource group.

  • If resource contention occurs between large queries and small queries and affects the response speed of small queries, send large queries to other resource groups.

  • If the query loads decrease and the resource group has redundant computing resources, manually decrease the amount of computing resources available for the resource group to reduce costs.

For a resource group for which the multi-cluster feature is enabled, the resource group is composed of multiple compute clusters of the same specifications. The multi-cluster feature provides the following advantages:

  • In elastic mode, you do not need to manually adjust the amount of computing resources available for the resource group to handle fluctuating query loads. AnalyticDB for MySQL automatically starts or shuts down compute clusters based on query loads.

  • In maximum mode, you can determine the total amount of computing resources available for the resource group by increasing or decreasing the number of compute clusters.

  • Compute clusters are mutually isolated from each other in the resource group. Large queries affect only the compute cluster in which the queries reside.

Usage notes

  • Multi-cluster scaling models are suitable only for interactive resource groups.

  • You cannot enable the multi-cluster feature for resource groups that are created for AnalyticDB for MySQL clusters earlier than V3.1.10.0. To use the multi-cluster feature, create an interactive resource group.

  • You cannot enable a resource scaling plan and the multi-cluster feature for the same interactive resource group.

Billing rules

After you enable the multi-cluster feature for an interactive resource group, the number of compute clusters in the resource group elastically scales. You are charged based on the scaled elastic resources. The amount of scaled elastic resources is calculated by using the following formula: Specifications per compute cluster × Number of scaled compute clusters. For more information, see Pricing for Data Lakehouse Edition.

Enable the multi-cluster feature

You can enable the multi-cluster feature when you create a resource group or by modifying the configuration of an existing resource group.

  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. Click the Resource Groups tab.

  3. On the Resource Groups tab, click Create Resource Group or find the resource group that you want to manage and click Modify in the Actions column.

  4. Make sure that the job type is Interactive and configure the parameters that are described in the following table.

    Parameter

    Description

    Database Engine

    The database engine used by the resource group. Select Xihe or Spark.

    • Xihe: The resource group supports only XIHE SQL queries.

    • Spark: The resource group supports only Spark jobs. Spark jobs are run in an interactive manner.

      Important

      This parameter is in invitational preview. To use this parameter, join the AnalyticDB for MySQL DingTalk group 33600023146.

    Cluster Size

    The size of a single compute cluster. Unit: AnalyticDB compute units (ACUs). The minimum value is 16 ACUs.

    Minimum Clusters

    The minimum number of compute clusters that you must run in the resource group. The value must be less than or equal to the maximum number of compute clusters. The minimum value is 1.

    • If you set the Minimum Clusters and Maximum Clusters parameters to different values, AnalyticDB for MySQL dynamically scales the amount of computing resources available for the resource group within the range of the minimum and maximum values based on query loads.

    • If you set the Minimum Clusters and Maximum Clusters parameters to the same value, the value must be greater than or equal to 2. After the resource group is created, AnalyticDB for MySQL starts the specified compute clusters to statically control the total amount of computing resources available for the resource group.

    Maximum Clusters

    The maximum number of compute clusters that you can run in the resource group. The maximum value is 10.

    • If you set the Minimum Clusters and Maximum Clusters parameters to different values, AnalyticDB for MySQL dynamically scales the amount of computing resources available for the resource group within the range of the minimum and maximum values based on query loads.

    • If you set the Minimum Clusters and Maximum Clusters parameters to the same value, the value must be greater than or equal to 2. After the resource group is created, AnalyticDB for MySQL starts the specified compute clusters to statically control the total amount of computing resources available for the resource group.

  5. Click OK.

    After you enable the multi-cluster feature, you can view the value of the Min/Max/Running Clusters parameter of the resource group on the Resource Groups tab. You can also click Monitor in the Actions column to view the metrics of the resource group.

Impacts of changing the maximum and minimum numbers of compute clusters

When you change the maximum and minimum numbers of compute clusters, the following impacts are imposed on the number of running compute clusters:

If the Minimum Clusters and Maximum Clusters parameters are set to different values:

  • Increase the maximum number of compute clusters: The number of running compute clusters does not change until additional computing resources are required to handle the query loads.

  • Decrease the maximum number of compute clusters: If the number of running compute clusters is greater than the specified maximum number of compute clusters, AnalyticDB for MySQL does not send new queries to the excessive compute clusters. After existing queries are executed on the excessive compute clusters, AnalyticDB for MySQL shuts down the compute clusters.

  • Increase the minimum number of compute clusters: AnalyticDB for MySQL starts additional compute clusters to meet the specified minimum number of compute clusters.

  • Decrease the minimum number of compute clusters: If the number of running compute clusters is greater than the specified minimum number of compute clusters, AnalyticDB for MySQL consecutively checks the query loads and shuts down the excessive compute clusters when the amount of computing resources is more than what is required to handle the query loads within a 5-minute time window.

If the Minimum Clusters and Maximum Clusters parameters are set to the same value:

  • Increase the maximum and minimum numbers of compute clusters: AnalyticDB for MySQL starts additional compute clusters to meet the specified maximum number of compute clusters.

  • Decrease the maximum and minimum numbers of compute clusters: AnalyticDB for MySQL does not send new queries to the excessive compute clusters. After existing queries are executed on the excessive compute clusters, AnalyticDB for MySQL shuts down the compute clusters.