Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17994

Add "Resource Group" feature in MariaDB

Details

    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:

      1. DBAs can create, alter, and drop resource groups with specified percentages of CPU and memory.
      2. Sessions assigned to a group are limited to the defined CPU and memory percentages.
      3. A new INFORMATION_SCHEMA.RESOURCE_GROUPS table displays group details, including both percentage limits.
      4. Performance schema extensions provide monitoring of CPU and memory usage per group.
      5. 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:

      1. Multi-tenant environments, where different tenants need isolated CPU resources.
      2. Workload prioritization, such as assigning batch jobs to specific vCPUs and real-time queries to others.
      3. 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 =

      {YES | NO}]
      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

          Activity

            This is a pretty serious limitation:

            Resource groups are unavailable if the thread pool plugin is installed.

            https://dev.mysql.com/doc/refman/8.0/en/resource-groups.html#resource-group-restrictions

            GeoffMontee Geoff Montee (Inactive) added a comment - This is a pretty serious limitation: Resource groups are unavailable if the thread pool plugin is installed. https://dev.mysql.com/doc/refman/8.0/en/resource-groups.html#resource-group-restrictions
            shaim Dominik Shaim added a comment -

            It's technically impossible to do this for next major version of MariaDB, correct?

            shaim Dominik Shaim added a comment - It's technically impossible to do this for next major version of MariaDB, correct?

            People

              serg Sergei Golubchik
              niljoshi Nilnandan Joshi
              Votes:
              6 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.