Version sans cache

Mise en cache désactivé. Réglage défaut pour cette page : actif (code DEF204)
Si l'affichage est trop lent, vous pouvez désactiver le mode utilisateur pour visualiser la version en cache.

Rechercher dans le manuel MySQL

13.7.2.2 CREATE RESOURCE GROUP Syntax

  1. CREATE RESOURCE GROUP group_name
  2.     TYPE = {SYSTEM|USER}
  3.     [VCPU [=] vcpu_spec [, vcpu_spec] ...]
  4.     [THREAD_PRIORITY [=] N]
  5.     [ENABLE|DISABLE]
  6.  
  7. vcpu_spec: {N | M - N}

CREATE RESOURCE GROUP is used for resource group management (see Section 8.12.5, “Resource Groups”). This statement creates a new resource group and assigns its initial attribute values. It requires the RESOURCE_GROUP_ADMIN privilege.

group_name identifies which resource group to create. If the group already exists, an error occurs.

The TYPE attribute is required. It should be SYSTEM for a system resource group, USER for a user resource group. The group type affects permitted THREAD_PRIORITY values, as described later.

The VCPU attribute indicates the CPU affinity; that is, the set of virtual CPUs the group can use:

  • If VCPU is not given, the resource group has no CPU affinity and can use all available CPUs.

  • If VCPU is given, the attribute value is a list of comma-separated CPU numbers or ranges:

    • Each number must be an integer in the range from 0 to the number of CPUs − 1. For example, on a system with 64 CPUs, the number can range from 0 to 63.

    • A range is given in the form MN, where M is less than or equal to N and both numbers are in the CPU range.

    • If a CPU number is an integer outside the permitted range or is not an integer, an error occurs.

Example VCPU specifiers (these are all equivalent):

  1. VCPU = 0,1,2,3,9,10
  2. VCPU = 0-3,9-10
  3. VCPU = 9,10,0-3
  4. VCPU = 0,10,1,9,3,2

The THREAD_PRIORITY attribute indicates the priority for threads assigned to the group:

  • If THREAD_PRIORITY is not given, the default priority is 0.

  • If THREAD_PRIORITY is given, the attribute value must be in the range from -20 (highest priority) to 19 (lowest priority). The priority for system resource groups must be in the range from -20 to 0. The priority for user resource groups must be in the range from 0 to 19. Use of different ranges for system and user groups ensures that user threads never have a higher priority than system threads.

ENABLE and DISABLE specify that the resource group is initially enabled or disabled. If neither is specified, the group is enabled by default. A disabled group cannot have threads assigned to it.

Examples:

  • Create an enabled user group that has a single CPU and the lowest priority:

    1. CREATE RESOURCE GROUP rg1
    2.   TYPE = USER
    3.   VCPU = 0
    4.   THREAD_PRIORITY = 19;
  • Create a disabled system group that has no CPU affinity (can use all CPUs) and the highest priority:

    1. CREATE RESOURCE GROUP rg2
    2.   TYPE = SYSTEM
    3.   THREAD_PRIORITY = -20

Resource group management is local to the server on which it occurs. CREATE RESOURCE GROUP statements are not written to the binary log and are not replicated.


Rechercher dans le manuel MySQL

Traduction non disponible

Le manuel MySQL n'est pas encore traduit en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 26/06/2006, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/mysql-rf-create-resource-group.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :en Manuel MySQL : https://dev.mysql.com/

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut