Define a new resource group.
CREATE RESOURCE GROUP name WITH (group_attribute=value [, ... ])
Where group_attribute is:
CPU_RATE_LIMIT=integer | CPUSET=tuple
MEMORY_LIMIT=integer
[ CONCURRENCY=integer ]
[ MEMORY_SHARED_QUOTA=integer ]
[ MEMORY_SPILL_RATIO=integer ]
[ MEMORY_AUDITOR= {vmtracker | cgroup} ]
Create a new resource group for YMatrix database resource management. You can create resource groups to manage role resources or to manage resources for external components of YMatrix databases, such as PL/Container.
When the resource group is enabled, the resource group you create to manage the user role will identify the concurrent transactions, memory, and CPU limits for that role. You can assign such resource groups to one or more roles.
The resource group you create that manages resources that are external to YMatrix databases, such as PL/Container, identifies the memory and CPU limits of the component when the resource group is enabled. These resource groups use cgroups for CPU and memory management. Assigning resource groups to external components is component-specific. For example, when you configure the PL/Container runtime, you will assign a PL/Container resource group. You cannot assign resource groups created for external components to roles, nor can you assign resource groups created for roles to external components.
You must have SUPERUSER privileges to create a resource group. The maximum number of resource groups allowed in a YMatrix database cluster is 100.
The YMatrix database predefined two default resource groups: admin_group and default_group. These group names and group names none are retained.
To set appropriate restrictions for resource groups, YMatrix database administrators must be familiar with the queries that are typically executed on the system, as well as the users/roles that execute these queries and the external components they may use, such as PL/Containers.
After creating a role for the resource group, the group is assigned to one or more roles using the ALTER ROLE or CREATE ROLE command.
After creating a resource group to manage CPU and memory resources for external components, configure the external components to use the resource group. For example, configure the resource_group_id of the PL/Container runtime.
name
CONCURRENCY integer
CPU_RATE_LIMIT integer
CPUSET tuple
MEMORY_LIMIT integer
MEMORY_SHARED_QUOTA integer
MEMORY_SPILL_RATIO integer
MEMORY_AUDITOR {vmtracker | cgroup}
You cannot submit a CREATE RESOURCE GROUP command in an explicit transaction or a subtransaction.
Use the gp_toolkit.gp_resgroup_config system view to display the limit settings for all resource groups:
SELECT * FROM gp_toolkit.gp_resgroup_config;
Create a resource group with a CPU and memory limit percentage of 35:
CREATE RESOURCE GROUP rgroup1 WITH (CPU_RATE_LIMIT=35, MEMORY_LIMIT=35);
Create a resource group with a concurrent transaction limit of 20, a memory limit of 15, and a CPU limit of 25:
CREATE RESOURCE GROUP rgroup2 WITH (CONCURRENCY=20,
MEMORY_LIMIT=15, CPU_RATE_LIMIT=25);
Create a resource group to manage PL/Container resources, specifying memory limits of 10 and CPU limits of 10:
CREATE RESOURCE GROUP plc_run1 WITH (MEMORY_LIMIT=10, CPU_RATE_LIMIT=10,
CONCURRENCY=0, MEMORY_AUDITOR=cgroup);
Create a resource group with a memory limit percentage of 11 and assign it CPU cores 1 to 3:
CREATE RESOURCE GROUP rgroup3 WITH (CPUSET='1-3', MEMORY_LIMIT=11);
CREATE RESOURCE GROUP is a YMatrix data extension. There is no resource group or resource management in the SQL standard.