4.1 Creating and Managing Resource Groups

Table of Contents Previous Next


4 EDB Resource Manager : 4.1 Creating and Managing Resource Groups

Use the CREATE RESOURCE GROUP command to create a new resource group.
The CREATE RESOURCE GROUP command creates a resource group with the specified name. Resource limits can then be defined on the group with the ALTER RESOURCE GROUP command. The resource group is accessible from all databases in the Advanced Server instance.
To use the CREATE RESOURCE GROUP command you must have superuser privileges.
Use the ALTER RESOURCE GROUP command to change the attributes of an existing resource group. The command syntax comes in three forms.
ALTER RESOURCE GROUP group_name RENAME TO new_name;
ALTER RESOURCE GROUP group_name SET
resource_type { TO | = } { value | DEFAULT };
ALTER RESOURCE GROUP group_name RESET resource_type;
The ALTER RESOURCE GROUP command changes certain attributes of an existing resource group.
The first form with the RENAME TO clause assigns a new name to an existing resource group.
The second form with the SET resource_type TO clause either assigns the specified literal value to a resource type, or resets the resource type when DEFAULT is specified. Resetting or setting a resource type to DEFAULT means that the resource group has no defined limit on that resource type.
The third form with the RESET resource_type clause resets the resource type for the group as described previously.
To use the ALTER RESOURCE GROUP command you must have superuser privileges.
value | DEFAULT
When value is specified, the literal value to be assigned to resource_type. When DEFAULT is specified, the assignment of resource_type is reset for the resource group.
The following are examples of the ALTER RESOURCE GROUP command.
The following query shows the results of the ALTER RESOURCE GROUP commands to the entries in the edb_resource_group catalog.
Use the DROP RESOURCE GROUP command to remove a resource group.
The DROP RESOURCE GROUP command removes a resource group with the specified name.
To use the DROP RESOURCE GROUP command you must have superuser privileges.
Use the SET edb_resource_group TO group_name command to assign the current process to a specified resource group as shown by the following.
A default resource group can be assigned to a role using the ALTER ROLE ... SET command. For more information about the ALTER ROLE command, please refer to the PostgreSQL core documentation available at:
A default resource group can be assigned to a database by the ALTER DATABASE ... SET command. For more information about the ALTER DATABASE command, please refer to the PostgreSQL core documentation available at:
The entire database server instance can be assigned a default resource group by setting the edb_resource_group configuration parameter in the postgresql.conf file as shown by the following.
A change to edb_resource_group in the postgresql.conf file requires a configuration file reload before it takes effect on the database server instance.
Set edb_resource_group to DEFAULT or use RESET edb_resource_group to remove the current process from a resource group as shown by the following.
For removing a default resource group from a role, use the ALTER ROLE ... RESET form of the ALTER ROLE command.
For removing a default resource group from a database, use the ALTER DATABASE ... RESET form of the ALTER DATABASE command.
For removing a default resource group from the database server instance, set the edb_resource_group configuration parameter to an empty string in the postgresql.conf file and reload the configuration file.
The columns in edb_all_resource_groups are the following:
group_name. Name of the resource group.
active_processes. Number of active processes in the resource group.
cpu_rate_limit. The value of the CPU rate limit resource type assigned to the resource group.
per_process_cpu_rate_limit. The CPU rate limit applicable to an individual, active process in the resource group.
dirty_rate_limit. The value of the dirty rate limit resource type assigned to the resource group.
per_process_dirty_rate_limit. The dirty rate limit applicable to an individual, active process in the resource group.
Note: Columns per_process_cpu_rate_limit and per_process_dirty_rate_limit do not show the actual resource consumption used by the processes, but indicate how EDB Resource Manager sets the resource limit for an individual process based upon the number of active processes in the resource group.
The following shows edb_all_resource_groups when resource group resgrp_a contains no active processes, resource group resgrp_b contains two active processes, and resource group resgrp_c contains one active process.
In the edb_all_resource_groups view, note that the per_process_cpu_rate_limit and per_process_dirty_rate_limit values are roughly the corresponding CPU rate limit and dirty rate limit divided by the number of active processes.

4 EDB Resource Manager : 4.1 Creating and Managing Resource Groups

Table of Contents Previous Next