After you divide computing resources of a cluster into resource pools, you can manage the resource pools and better utilize the computing resources. This topic describes how to create and modify resource pools and bind or unbind users to or from resource pools.

Prerequisites

An AnalyticDB for MySQL elastic cluster is created.

Background information

You can divide the computing resources of an AnalyticDB for MySQL elastic cluster into multiple resource pools and bind different users to each resource pool to implement isolation. This way, you can schedule computing tasks based on priorities to protect core business from being affected by complex computing and emergencies. You can also classify queries and allocate resources to maximize cluster performance. For more information about resource pools, see Resource pool overview.

For example, assume that User a and User b need to perform simple queries, and User c needs to perform complex queries and analysis on large amounts of data. In this case, you can bind User a and User b to the resource pool named source_a whose query type is Interactive, and bind User c to the resource pool named source_b whose query type is Batch. This way, when User c performs large-scale computing and queries, the performance of simple queries is not affected.

Create a resource pool

  1. Log on to the AnalyticDB for MySQL console.
  2. In the upper-left corner of the page, select the region and resource group of the cluster.
  3. In the left-side navigation pane, click Clusters.
  4. Click the ID of the required cluster.
  5. In the left-side navigation pane, click Resource Pool Management.
  6. On the Resource Pool Management page, click New Resource Pool in the upper-right corner.
  7. Configure the resource pool.
    Parameter Description
    Resource Pool Name The name of the resource pool. The name must be 2 to 30 characters in length and can contain only letters, digits, and underscores (_). The name must start with a letter.
    Query Type The type of SQL queries used in the resource pool. Default value: Default_Type. Valid values: For more information about this issue, see Query execution modes.
    • Default_Type.
    • Batch: the ETL batch computing mode. This type is ideal for complex queries on a large amount of data. Intermediate query results can be written to disks. If you query large amounts of data, the query performance is degraded, but computing nodes do not fail.
    • Interactive: the interactive query mode. This type is ideal for simple queries. Quick interactive queries are based only on memory, which delivers good query performance. However, if the data amount exceeds the processing capacity of the server, queries may fail.
    Resources The amount of resources allocated to the resource pool.
  8. Click OK to create the resource pool.

Modify a resource pool

After you create a resource pool, you can modify its query type and amount of resources.
Note You can modify only the query type of the default resource pool. However, you cannot modify the amount of resources of the resource pool. The amount of resources in the default resource pool is calculated based on the following formula: Amount of resources in the default resource pool = Total amount of resources in a cluster - Amount of resources occupied by other resource pools in the cluster.
  1. On the Resource Pool Management page, click Modify in the Actions column corresponding to the required resource pool.
  2. Modify the Query Type or Resources parameter.
  3. Click OK.

Bind or unbind a user

The binding relationship between users and resource pools allows you to meet the needs of multiple tenants and hybrid loads within instances. For more information about this issue, see Binding between users and resource pools.

Note A resource pool can be bound to multiple users. Each user can be bound to only one resource pool.
  1. On the Resource Pool Management page, click Bind User in the Actions column corresponding to the required resource pool.
  2. On the Bind User page, select a user that you want to bind from the Username drop-down list and click Bind User. In the Bind User message, click OK.
  3. To bind more users, repeat Step 2.
  4. To unbind a user, click Unbind in the Actions column corresponding to the user in the username list. In the Unbind User message, click OK.

Related SQL statements

CREATE RESOURCE GROUP

ALTER RESOURCE GROUP

DROP RESOURCE GROUP