Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
Objective:The goal is to enable DBAs to allocate CPU and memory resources to workloads or users via resource groups, using percentage-based parameters for both CPU (CPU_PERCENT) and memory (MEMORY_PERCENT). This includes a new system schema for visibility and monitoring capabilities for both resources. Note: this implementation differs slightly from mysql implementation as memory is not tracked nor used in mysql implementation, and also in Postgres implementation either - a differentiating feature.
Acceptance Criteria:
- DBAs can create, alter, and drop resource groups with specified percentages of CPU and memory.
- Sessions assigned to a group are limited to the defined CPU and memory percentages.
- A new INFORMATION_SCHEMA.RESOURCE_GROUPS table displays group details, including both percentage limits.
- Performance schema extensions provide monitoring of CPU and memory usage per group.
- Sessions revert to a default group when their assigned group is dropped.
Benefits and Use Cases
This implementation enhances MariaDB's competitiveness with MySQL, particularly for:
- Multi-tenant environments, where different tenants need isolated CPU resources.
- Workload prioritization, such as assigning batch jobs to specific vCPUs and real-time queries to others.
- Monitoring and optimization, enabling DBAs to adjust resource allocation based on usage patterns.
Example of part of the SQL functions:
Resource Group Definition:
SQL Commands:
CREATE RESOURCE GROUP group_name CPU_PERCENT = cpu_percentage MEMORY_PERCENT = memory_percentage [ENABLED =
ALTER RESOURCE GROUP group_name [CPU_PERCENT = new_cpu_percentage] [MEMORY_PERCENT = new_memory_percentage] [ENABLED = {YES | NO}
]
DROP RESOURCE GROUP group_name
Properties:
group_name: Unique, up to 64 characters, case-insensitive.
cpu_percent: Integer between 1 and 100, representing the percentage of total CPU capacity (e.g., 25 for 25%). Default is unlimited if not specified.
memory_percent: Integer between 1 and 100, representing the percentage of total system RAM (e.g., 20 for 20%). Default is unlimited if not specified.
enabled: Boolean, defaults to YES; disabled groups cannot accept new assignments.
MySQL8.0 introduce "Resource Group" feature for reference implementation:
https://dev.mysql.com/doc/refman/8.0/en/resource-groups.html
Attachments
Issue Links
- is part of
-
MDEV-28906 MySQL 8.0 desired compatibility
-
- Open
-
- relates to
-
MDEV-31542 Add multi-tenancy catalogs to MariaDB
-
- Stalled
-
This is a pretty serious limitation:
https://dev.mysql.com/doc/refman/8.0/en/resource-groups.html#resource-group-restrictions