All Products
Search
Document Center

AnalyticDB:Create, modify, and delete a resource group

Last Updated:Jun 13, 2025

AnalyticDB for MySQL uses resource groups to isolate computing resources for batch processing and interactive queries. You can configure scheduled or automatic scaling of resources and determine the priority for executing queries. This topic describes how to create and manage a resource group.

Prerequisites

An AnalyticDB for MySQL Enterprise Edition, Basic Edition, or Data Lakehouse Edition cluster is created.

Billing rules

  • You are charged fees for the AnalyticDB compute unit (ACU) elastic resources used by interactive resource groups and job resource groups.

  • When you create an AI resource group in RayCluster deployment mode, you are charged for the corresponding resources.

    • If you set the Worker Resource Type parameter to CPU, you are charged for the ACU elastic resources used by the AI resource group.

    • If you set the Worker Resource Type parameter to GPU, you are charged based on the GPU specifications and quantity of the AI resource group.

    • You are charged based on the storage size specified by the Worker Disk Storage parameter.

You can use the following methods to view the amount of elastic resources used by the resource group:

  • Enterprise Edition and Basic Edition: In the left-side navigation pane, choose Cluster Management > Resource Management. On the Resource Overview tab, you can view the total amount of resources and that of reserved resources used by all resource groups. You can use the following formula to calculate the amount of elastic resources: Total amount of resources - Amount of reserved resources.

  • Data Lakehouse Edition: In the left-side navigation pane, choose Cluster Management > Resource Management. On the Resource Overview tab, you can view the total amount of computing resources and that of reserved computing resources used by all resource groups. You can use the following formula to calculate the amount of elastic resources: Total amount of computing resources - Amount of reserved computing resources.

Create a resource group

Each cluster has a default interactive resource group named user_default. New AnalyticDB for MySQL clusters of V3.2.2.8 or later also provide a default job resource group named serverless. If no other resource groups exist, all XIHE queries are executed by the user_default resource group, and all Spark jobs, such as Spark JAR and Spark SQL jobs, are executed by the serverless resource group. If you want to isolate resources among queries, you can create additional resource groups.

  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. 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. On the Resource Management page, click the Resource Groups tab. In the upper-right corner of the Resource Groups tab, click Create Resource Group.

  3. In the Create Resource Group panel, enter a resource group name and select an option from the Job Type drop-down list.

    • If you want to perform real-time analysis with high queries per second (QPS) and low response time (RT), select Interactive.

      An interactive resource group uses resident computing resources to execute queries in massively parallel processing (MPP) mode. In this mode, query requests are responded within milliseconds.

    • If you want to perform batch processing with high throughput, select Job.

      A job resource group pulls up temporary computing resources to execute queries in bulk synchronous parallel (BSP) mode. In this mode, query requests are responded within seconds or minutes. The amount of temporary computing resources that can be pulled up varies based on the size of the job that you run, ranging from 0 ACUs to the maximum resource amount of the job resource group.

    • If you want to perform heterogeneous computing, select AI.

      An AI resource group uses GPU and CPU heterogeneous computing resources to support various deployment modes such as MLSQL and RayCluster.

    Important

    After you create a resource group, you cannot change the job type of the resource group.

  4. Configure the property parameters of the resource group based on the selected job type. Then, click OK.

    Properties of an interactive resource group

    Parameter

    Description

    Engine

    • XIHE: The resource group supports only XIHE SQL jobs.

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

    Important

    After you create a resource group, you cannot change the engine of the resource group.

    Automatic Stop

    Specifies whether to enable the automatic stop feature for the resource group. If an interactive resource group remains idle for a specific period of time after all SQL statements are executed, the system uses the automatic stop feature to automatically release the compute clusters that are started in the resource group.

    The automatic stop feature prevents resource waste and reduces resource costs. However, if you execute queries after the started compute clusters are released, resources need to be re-pulled up and latency occurs.

    Important

    This parameter is available only if you set the Engine parameter to Spark.

    Cluster Size

    • The size of a single compute cluster when the Engine parameter is set to XIHE. Unit: AnalyticDB compute units (ACUs). The minimum value is 16 ACUs.

    • The size of a single compute cluster when the Engine parameter is set to Spark. Set this parameter to the number of ACUs that you want to allocate to each Spark application. The minimum value is 24 ACUs. You can run multiple Spark applications in each Spark interactive resource group. You can specify the Minimum Clusters and Maximum Clusters parameters to define the range of Spark applications that can run in the resource group.

      For more information, see the "Mappings between the compute cluster size and Spark driver and executor specifications" section of the Multi-cluster scaling models topic.

    Minimum Clusters

    Maximum Clusters

    Minimum Clusters: the minimum number of compute clusters that you must run in the resource group. The minimum value is 1.

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

    If you specify different values for the Minimum Clusters and Maximum Clusters parameters, AnalyticDB for MySQL dynamically scales the number of compute clusters available for the resource group within the range of the minimum and maximum values based on query loads.

    If you specify the same value for the Minimum Clusters and Maximum Clusters parameters, AnalyticDB for MySQL starts the specified compute clusters after the resource group is created to statically maintain the total amount of computing resources available for the resource group.

    Note

    If you set the Minimum Clusters or Maximum Clusters parameter to a value that is greater than or equal to 2, the multi-cluster feature is enabled for the resource group. For information about the multi-cluster feature, see Multi-cluster scaling models.

    Job Resubmission Rules

    The rules that resubmit the queries executed for a period of time longer than the specified execution duration threshold to the destination resource group. For more information, see Job resubmission.

    Important

    This parameter is available only if you set the Engine parameter to XIHE.

    Spark Configuration

    The Spark application configuration parameters that can be applied to all Spark jobs executed in the resource group. If you want to configure parameters for a specific Spark job, you can specify values for the parameters in the code editor when you submit the job.

    For information about the Spark configuration parameters, see Spark application configuration parameters.

    Important

    This parameter is available only if you set the Engine parameter to Spark.

    Properties of a job resource group

    Parameter

    Description

    Minimum Computing Resources

    The minimum amount of computing resources. Set the value to 0 ACUs.

    Important

    After you create a job resource group, you cannot change the minimum computing resources.

    Maximum Computing Resources

    The maximum amount of computing resources. Set this parameter within the range of 8 ACUs to 1,024 ACUs in increments of 8 ACUs. If you want to change the maximum value of the Maximum Computing Resources parameter, submit a ticket.

    Spot Instance

    Specifies whether to enable the spot instance feature for the job resource group.

    After you enable the spot instance feature for the job resource group, Spark jobs that run in the job resource group attempt to use the spot instance resources. For more information, see Spot instances.

    Spark Configuration

    The Spark application configuration parameters that can be applied to all Spark jobs executed in the resource group. If you want to configure parameters for a specific Spark job, you can specify values for the parameters in the code editor when you submit the job.

    For information about the Spark configuration parameters, see Spark application configuration parameters.

    Properties of an AI resource group

    Parameter

    Description

    Deployment Mode

    The deployment mode of the resource group. Select RayCluster.

    Head Resource Specifications

    The head node is responsible for managing Ray metadata, running the Global Control Store (GCS) service, and scheduling tasks, but does not execute tasks.

    The head resource specifications refer to the number of CPU cores. You can choose specifications such as small, m.xlarge, and m.2xlarge. The number of CPU cores is the same between head resource specifications and Spark resource specifications. For more information, see Spark resource specifications.

    Important

    The head node is responsible for job scheduling. Select the head resource specifications based on the overall scale of the Ray cluster.

    Worker Group Name

    The name of the worker group. You can configure multiple worker groups with different names in one AI resource group.

    Worker Resource Type

    The type of the worker group, which can be CPU or GPU.

    • If your business involves daily computing tasks, multitasking, or complex logical operations, we recommend that you select CPU.

    • If your business involves large-scale data parallel processing, machine learning, or deep learning training, we recommend that you select GPU.

    Worker Resource Specifications

    • If you set the Worker Resource Type parameter to CPU, you can select specifications such as small, m.xlarge, and m.2xlarge. The number of CPU cores is the same between head resource specifications and Spark resource specifications. For more information, see Spark resource specifications.

    • If you set the Worker Resource Type parameter to GPU, submit a ticket for technical assistance because the specifications are related to GPU models and inventory.

    Worker Disk Storage

    The disk storage is used to store Ray logs, temporary data, and overflow data from Ray distributed object storage. Unit: GB. Valid values: 30 to 2000. Default value: 100.

    Important

    Disks are used to temporarily store data. Do not use disks for long-term data storage.

    Minimum Workers

    Maximum Workers

    Minimum Workers: the minimum number of worker nodes that are required in a worker group, with a minimum value of 1.

    Maximum Workers: the maximum number of worker nodes that are allowed in a worker group, with a maximum value of 8.

    Each worker group can be automatically scaled. If the minimum number of worker nodes is different from the number of maximum worker nodes in a worker group, AnalyticDB for MySQL dynamically changes the number of worker nodes within the range based on the number of tasks. If multiple worker groups exist, AnalyticDB for MySQL performs automatic matching to prevent overloading or idling of a single worker group.

    Distribution Unit

    The number of GPUs that are allocated to each worker node. Example: 1/3.

    Important

    This parameter is required only when you set the Worker Resource Type parameter to GPU.

Modify a resource group

Properties that can be modified

  • You can modify the following properties for custom resource groups:

    • Interactive resource group: Automatic Stop, Cluster Size, Minimum Clusters, Maximum Clusters, Job Resubmission Rules, and Spark Configuration.

    • Job resource group: Maximum Computing Resources, Spot Instance, and Spark Configuration.

    • AI resource group (RayCluster deployment mode): Head Resource Specifications, Worker Resource Type, Worker Resource Specifications, Worker Disk Storage, Minimum Workers, and Maximum Workers.

    You cannot modify other properties, including Resource Group Name, Job Type, Engine for interactive resource groups, Minimum Computing Resources for job resource groups, and Deployment Mode and Worker Group Name for AI resource groups.

  • For the default resource groups named user_default and serverless:

    • In Enterprise Edition and Basic Edition, you can modify only the Job Resubmission Rules property for the user_default resource group and cannot modify properties for the serverless resource group.

    • In Lakehouse Edition, you can modify the Reserved Computing Resources and Job Resubmission Rules for the user_default resource group and cannot modify properties for the serverless resource group.

Procedure

  1. On the Resource Groups tab, find the resource group that you want to modify and click Modify in the Actions column.

  2. In the Modify Resource Group panel, modify the parameter values and click OK.

    When the modification takes effect, the status of the resource group changes to Running.

Delete a resource group

You can delete custom resource groups, but you cannot delete the default resource groups named user_default and serverless.

Impacts

  • If you delete a resource group, jobs that are running in the resource group are interrupted.

  • After you delete the resource group that is used to run a XIHE SQL job or a Spark job, specify a different resource group for the job. If you do not specify a different resource group, the default resource group is used to run the XIHE SQL job, or an error occurs on the Spark job.

Procedure

On the Resource Groups tab, find the resource group that you want to delete and click Delete in the Actions column. In the Delete Resource Group message, click OK.

Monitor the resource usage

You can view the resource usage at the cluster level, the resources and workloads at the resource group level, and the resource consumption at the job level. For more information about the resource usage metrics, see the "Resource group monitoring" section of the Metric overview topic.

View the reserved and elastic resources of a cluster

  • Enterprise Edition and Basic Edition: In the left-side navigation pane, choose Cluster Management > Resource Management. On the Resource Overview tab, you can view the total resources and reserved resources of all resource groups in the cluster at a specific point in time. The amount of elastic resources can be calculated by using the following formula: Amount of total resources - Amount of reserved resources.

  • Data Lakehouse Edition: In the left-side navigation pane, choose Cluster Management > Resource Management. On the Resource Overview tab, you can view the total computing resources and reserved computing resources of all resource groups in the cluster at a specific point in time. The amount of elastic resources can be calculated by using the following formula: Amount of total computing resources - Amount of reserved computing resources.

View the resources and workloads of a resource group

You can view the computing resources that are actually used by a resource group. You can also view the following metrics related to the workloads of a resource group: the number of running XIHE SQL statements, the number of queuing XIHE SQL statements, the number of Spark engines, and the number of connections.

In the left-side navigation pane of an AnalyticDB for MySQL cluster, choose Cluster Management > Resource Management. On the Resource Management page, click the Resource Groups tab. On the Resource Groups tab, find the resource group that you want to manage and click Monitoring in the Actions column to view the computing resources that are actually used by the resource group.

View the resources consumed by a job

The Job Usage Statistics tab provides statistical information about the resource consumption of the following jobs: XIHE BSP jobs, Spark jobs, and data synchronization and migration jobs from Simple Log Service or ApsaraMQ for Kafka in the AnalyticDB for MySQL console.

In the left-side navigation pane of an AnalyticDB for MySQL cluster, choose Cluster Management > Resource Management. On the Resource Management page, click the Job Usage Statistics tab. On the Job Usage Statistics tab, view the total resources, reserved resources, elastic resources, and spot instance resources that are consumed by each job.

Associate with or disassociate from a database account

If you want to isolate resources among queries that are initiated by different database accounts, you can associate different resource groups with the database accounts. After you associate a resource group with a database account, the system routes the SQL queries to the associated resource group if you do not specify a resource group for SQL queries initiated by the database account.

Association rules

  • You can associate each database account with only one resource group. You can associate each resource group with one or more database accounts.

  • If a database account is not associated with a custom resource group, the database account is associated with the default resource group.

  • You cannot associate the user_default or serverless resource group with a database account.

  • When you delete a resource group or a database account, the associated relationship is dissolved.

Procedure

Associate with or disassociate from a database account in the AnalyticDB for MySQL console

  1. In the left-side navigation pane of an AnalyticDB for MySQL cluster, choose Cluster Management > Resource Management. On the Resource Management page, click the Resource Groups tab. On the Resource Groups tab, find the resource group that you want to manage and click Associate with Account in the Actions column.

  2. In the Associate with Account panel, select a database account from the Database Account drop-down list and click Associate with Account. In the Associate with Account message, click OK.

    You can associate a resource group with only a single database account at a time. To associate the resource group with multiple database accounts, repeat Step 2.

    If no database accounts are created, the drop-down list is empty. In this case, create a database account first. For more information, see Create a database account.

  3. To disassociate the resource group from a database account, find the database account and click Disassociate in the Actions column in the Associate with Account panel. In the Disassociate from Database Account message, click OK.

Call API operations to associate with or disassociate from a database account

FAQ

An AnalyticDB for MySQL cluster has 32 ACUs of reserved resources, and you create a job resource group for the cluster. Does the job resource group consume 32 ACUs of reserved resources together with the default resource groups?

If you use an AnalyticDB for MySQL Enterprise Edition or Basic Edition cluster, the reserved resources of the cluster can be allocated only to the default resource group named user_default. The default resource group named serverless and the job or interactive resource groups that you created can consume only elastic resources.

If you use an AnalyticDB for MySQL Data Lakehouse Edition cluster, the reserved resources of the cluster can be allocated to the default resource group named user_default, the default resource group named serverless, and the job or interactive resource groups that you created. The minimum or maximum computing resources of the default resource group are the reserved resources allocated to the default resource group named user_default. The difference between the reserved resources and the minimum or maximum resources of the default resource group named user_default represents the resources that can be allocated to the default resource group named serverless and the job or interactive resource groups that you created.

References