DEV Community

Qing
Qing

Posted on

Resource Management Preparation(2)

Creating a Resource Pool
Background
openGauss creates resource pools to divide host resources. After resource load management is enabled, the default resource pool alone is insufficient to address the resource load management requirements of services. Therefore, new resource pools must be used to reallocate system resources for granular control purposes. Table 1 describes the features of a common resource pool.

Table 1 Features of a common resource pool

Image description

After resource load management is enabled, the system automatically creates default_pool. If no resource pool is specified for a session or user, they will be automatically associated with default_pool. By default, default_pool is associated with the DefaultClass:Medium Cgroup and does not limit the number of concurrent services. Table 2 describes the attributes of default_pool.

Table 2 default_pool attributes

Image description

Prerequisites
You are familiar with the CREATE RESOURCE POOL, ALTER RESOURCE POOL, and DROP RESOURCE POOLsyntax.

Procedure
Creating a resource pool

  1. Perform the steps in Using gsql to Connect to a Database.

  2. Create a group resource pool and associate it with the specified sub-Class Cgroup. In the following example, the group resource pool named resource_pool_a is associated with the class_a Cgroup.

Image description

3.Create a service resource pool and associate it with the specified Workload Cgroup. In the following example, the service resource pool named resource_pool_a1 is associated with the workload_a1 Cgroup.

Image description

Image description

Managing resource pools

Modify resource pool attributes. In the following example, the Cgroup associated with the resource pool resource_pool_a2 is changed to class_a:workload_a1 (assuming that class_a:workload_a1 is not associated with any other resource pools).

Image description

Deleting a resource pool

Delete a resource pool. For example, run the following command to delete the resource pool resource_pool_a2:

Image description

Image description

Viewing Resource Pool Information

Image description

Run the following command to view the information of all the resource pools of the current cluster:

Image description

Image description

Image description

· View information about Cgroups associated with a resource pool. For details, see statistics-information-functions.

In the following example, resource_pool_a1 is the name of the resource pool.

Image description

Table 3 gs_control_group_info attributes

Image description

Top comments (0)