YMatrix
Quick Start
Connecting
Benchmarks
Deployment
Data Usage
Manage Clusters
Upgrade
Global Maintenance
Expansion
Monitoring
Security
Best Practice
Technical Principles
Data Type
Storage Engine
Execution Engine
Streaming Engine(Domino)
MARS3 Index
Extension
Advanced Features
Advanced Query
Resource Groups
Federal Query
Grafana
Backup and Restore
Disaster Recovery
Guide
Performance Tuning
Troubleshooting
Tools
Configuration Parameters
SQL Reference
By default, no resource management policy is enabled when YMatrix database is installed. To use resource groups, set resource_scheduler='on'.
gp_resource_manager server configuration parameter to either "group" or "group-v2":gpconfig -c gp_resource_manager -v "group"
gpconfig -c gp_resource_manager -v "group-v2"
mxstop
mxstart
Once enabled, all transactions submitted by a role are directed to the resource group assigned to that role and are subject to the group’s concurrency, memory, and CPU limits.
YMatrix automatically creates three built-in role-based resource groups: admin_group, default_group, and system_group. When resource groups are enabled, any role not explicitly assigned a resource group is placed into the default group based on its role type:
SUPERUSER roles are assigned to admin_group.default_group.system_group.Note: You cannot manually assign any role to
system_group.
The default configurations for these role resource groups are as follows:
| Parameter | admin_group | default_group | system_group |
|---|---|---|---|
| CONCURRENCY | 10 | 5 | 0 |
| CPU_MAX_PERCENT | 10 | 20 | 10 |
| CPU_WEIGHT | 100 | 100 | 100 |
| CPUSET | -1 | -1 | -1 |
| IO_LIMIT | -1 | -1 | -1 |
| MEMORY_LIMIT | -1 | -1 | -1 |
| MIN_COST | 0 | 0 | 0 |
Use the CREATE RESOURCE GROUP command to create a new resource group. When creating a resource group for roles, specify a name and a CPU allocation mode (either cores or percentage). You must provide a limit for either CPU_MAX_PERCENT or CPUSET.
Example
Create a resource group named rgroup1 with a concurrency limit of 20, memory quota of 250 MB, CPU weight of 500, and minimum cost of 50:
CREATE RESOURCE GROUP rgroup1 WITH (CONCURRENCY=20, CPU_MAX_PERCENT=20, MEMORY_QUOTA=250, CPU_WEIGHT=500, MIN_COST=50);
The CPU and memory limits defined for rgroup1 are shared among all roles assigned to this group.
Use the ALTER RESOURCE GROUP command to update a resource group’s limits:
ALTER RESOURCE GROUP rg_role_light SET CONCURRENCY 7;
ALTER RESOURCE GROUP exec SET MEMORY_QUOTA 30;
ALTER RESOURCE GROUP rgroup1 SET CPUSET '1;2,4';
Note!
TheCONCURRENCYvalue ofadmin_groupcannot be set or changed to 0.
Use the DROP RESOURCE GROUP command to remove a resource group. To drop a resource group assigned to roles, ensure that:
DROP RESOURCE GROUP exec;