Skip to content
  • Thayumanavar S's avatar
    c47051b4
    WL#9467 - Resource Groups. · c47051b4
    Thayumanavar S authored
        The WL provides the resource group functionality. It meets the
        following functionality requirements:
        1. It provides functionality to create, drop and alter resource groups.
           The resource group associate a set of controllers which can be applied to
           resources of the system. This is to manage and throttle the resource usage
           consumption for different workloads. In the current WL, resource groups
           contain specification of CPU affinity and thread priority which can be
           applied to threads (which are representatives of workloads).
    
        2. Resource groups have the attributes name, type (SYSTEM or USER), resource
           group state (enabled or disabled), CPU ID list and thread priority. Resource
           groups can be managed by CREATE RESOURCE GROUP, ALTER RESOURCE GROUP and
           DROP RESOURCE GROUP statements.
    
        3. Resource group can be associated with a thread, a session and a group of
           threads. We can provide a hint to run a particular query using a resource
           group. The SET RESOURCE GROUP and the hint specification allow to do it.
    
        4. Every thread in the system by default is associated with USR_default or
           SYS_default resource groups. These resource groups by default allow a
           thread to be run on all CPUS and have the normal (0) thread priority
           of the system.
    
        5. There is a FORCE option associated with ALTER and DROP RESOURCE GROUP
           statements. It has the following semantics:
           (i). FORCE allows a resource group to be disabled even when some threads
                are using the resource group. It moves the threads (of that
                resource group) into their respective default resource groups.
           (ii). FORCE allows a resource group to be dropped while some threads are
                 associated with the resource group. The threads of this resource group
                 are moved to respective default resource groups.
    
            Without FORCE, if some threads are using the resource group, then an error
            ER_RESOURCE_GROUP_BUSY shall be returned.
    
        6. RESOURCE_GROUP_ADMIN privilege is required for CREATE, DROP and ALTER RESOURCE
           GROUP operation. In addition, this privilege allows assignment of system
           and user resource groups to system & user thread respectively.
           RESOURCE_GROUP_USER privilege is required to assign user resource groups with
           user threads.
    
        7. Resource group feature is not supported on MacOS and the error ER_FEATURE_UNSUPPORTED
           shall be returned on this platform if user attempts to use the resource group related
           actions. Thread priority is unsupported on FreeBSD and Solaris. In linux, the mysqld
           executable need to have CAP_SYS_NICE capability (to have thread priority tuning available).
           On this platform, if user attempts to set/tune the thread priority, a warning
           indicating the attribute shall be raised.
    
        8. Performance schema table threads is augmented with a RESOURCE_GROUP column
           and this functionality is provided by the WL#8881.
    
        9. The resource groups are persisted in the the data dictionary mysql.resource_groups and
           shall be available across reboots and future upgrades.
           The INFORMATION_SCHEMA.RESOURCE_GROUPS view shall expose the resource groups
           defined.
        A common function to validate UTF8 string is provided and this function is used
        from other subsystems in addition to it's use in resource group.
    c47051b4
    WL#9467 - Resource Groups.
    Thayumanavar S authored
        The WL provides the resource group functionality. It meets the
        following functionality requirements:
        1. It provides functionality to create, drop and alter resource groups.
           The resource group associate a set of controllers which can be applied to
           resources of the system. This is to manage and throttle the resource usage
           consumption for different workloads. In the current WL, resource groups
           contain specification of CPU affinity and thread priority which can be
           applied to threads (which are representatives of workloads).
    
        2. Resource groups have the attributes name, type (SYSTEM or USER), resource
           group state (enabled or disabled), CPU ID list and thread priority. Resource
           groups can be managed by CREATE RESOURCE GROUP, ALTER RESOURCE GROUP and
           DROP RESOURCE GROUP statements.
    
        3. Resource group can be associated with a thread, a session and a group of
           threads. We can provide a hint to run a particular query using a resource
           group. The SET RESOURCE GROUP and the hint specification allow to do it.
    
        4. Every thread in the system by default is associated with USR_default or
           SYS_default resource groups. These resource groups by default allow a
           thread to be run on all CPUS and have the normal (0) thread priority
           of the system.
    
        5. There is a FORCE option associated with ALTER and DROP RESOURCE GROUP
           statements. It has the following semantics:
           (i). FORCE allows a resource group to be disabled even when some threads
                are using the resource group. It moves the threads (of that
                resource group) into their respective default resource groups.
           (ii). FORCE allows a resource group to be dropped while some threads are
                 associated with the resource group. The threads of this resource group
                 are moved to respective default resource groups.
    
            Without FORCE, if some threads are using the resource group, then an error
            ER_RESOURCE_GROUP_BUSY shall be returned.
    
        6. RESOURCE_GROUP_ADMIN privilege is required for CREATE, DROP and ALTER RESOURCE
           GROUP operation. In addition, this privilege allows assignment of system
           and user resource groups to system & user thread respectively.
           RESOURCE_GROUP_USER privilege is required to assign user resource groups with
           user threads.
    
        7. Resource group feature is not supported on MacOS and the error ER_FEATURE_UNSUPPORTED
           shall be returned on this platform if user attempts to use the resource group related
           actions. Thread priority is unsupported on FreeBSD and Solaris. In linux, the mysqld
           executable need to have CAP_SYS_NICE capability (to have thread priority tuning available).
           On this platform, if user attempts to set/tune the thread priority, a warning
           indicating the attribute shall be raised.
    
        8. Performance schema table threads is augmented with a RESOURCE_GROUP column
           and this functionality is provided by the WL#8881.
    
        9. The resource groups are persisted in the the data dictionary mysql.resource_groups and
           shall be available across reboots and future upgrades.
           The INFORMATION_SCHEMA.RESOURCE_GROUPS view shall expose the resource groups
           defined.
        A common function to validate UTF8 string is provided and this function is used
        from other subsystems in addition to it's use in resource group.
Loading