Resource Management

Kinetica provides a SQL interface for managing resource groups, which can be used to limit memory and thread usage, and execution priority for a user or group of users.

The ability to manage resource groups is available through SQL, using the following commands:

See Security for details on assigning resource groups to users and roles.


CREATE RESOURCE GROUP

Resource groups require only a name to be created, all limits are optional. Resource group names are case-sensitive and must contain only letters, digits, and underscores, and cannot begin with a digit. A resource group must also not be named the same as an existing resource group, including the default resource groups: kinetica_system_resource_group & kinetica_default_resource_group.

CREATE RESOURCE GROUP Syntax
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
CREATE RESOURCE GROUP <resource group name>
[ RANK <FIRST | LAST | BEFORE <group name> | AFTER <group name>> ]
[
    TIER LIMITS
    (
        <tier name> USING (<tier property name> = <tier property value>[,...]),
        ...
        <tier name> USING (<tier property name> = <tier property value>[,...])
    )
]
[ WITH OPTIONS (<resource property name> = <resource property value>[,...]) ]
ParametersDescription
<resource group name>Name of the resource group to create.
RANK

Designation of where in the ordering of applicable resource groups this one should exist. For a given set of resource groups, the one that is ranked before all the others will be used.

RANK designations include:

KeywordDescription
FIRSTMake this resource group the new first one in the ordering.
LASTMake this resource group the new last one in the ordering.
BEFORE <group name>Place this resource group before the one specified by group name in the ordering.
AFTER <group name>Place this resource group after the one specified by group name in the ordering.
TIER LIMITS

Optional indicator that a set of tier names and corresponding property assignments will follow.

Parameters for each tier assignment are as follows:

KeywordDescription
tier name

Name of the tier to which limits will be assigned:

NameDescription
VRAMConfigure the VRAM tier.
RAMConfigure the RAM tier.
tier property name

Name of the tier property to which a limit will be assigned:

PropertyDescription
max_memoryMaximum amount of memory per rank that can be used in the associated tier.
tier property valueValue to assign the corresponding tier property.
WITH OPTIONS

Optional indicator that a comma-delimited list of resource group property option/value assignments will follow.

See Resource Group Options for the complete list of options.


Resource Group Options

The following options can be specified to further modify a resource group configuration.

OptionDescription
max_cpu_concurrencyMaximum number of simultaneous threads that will be used to execute a request. Must be >= 4.
max_dataMaximum amount of data, in bytes, that can be used by all database objects within this group; for example, a max_data of 1,000,000,000 would limit a user with this resource group to a total of 1GB of data usage across all tables, views, graphs, etc., system wide.
max_scheduling_priorityMaximum scheduling priority of a task.
max_tier_priorityMaximum eviction priority of a tiered object.

Examples

For example, to create a simple unlimited resource group with default settings:

CREATE RESOURCE GROUP Example
1
CREATE RESOURCE GROUP unlimited

To create a memory_over_execution resource group, with high tier capacity limits, but low execution options:

CREATE RESOURCE GROUP with Tier Limits & Options Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
CREATE RESOURCE GROUP memory_over_execution
TIER LIMITS
(
    VRAM USING (max_memory = 10737418240),
    RAM USING (max_memory = 107374182400)
)
WITH OPTIONS
(
    max_cpu_concurrency = 5,
    max_scheduling_priority = 30,
    max_tier_priority = 4
)

To create a execution_over_memory resource group, with lower tier capacity limits, but higher execution options, as compared to the memory_over_execution group:

CREATE RESOURCE GROUP with Ranking Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
CREATE RESOURCE GROUP execution_over_memory
RANK BEFORE memory_over_execution
TIER LIMITS
(
    VRAM USING (max_memory = 1073741824),
    RAM USING (max_memory = 10737418240)
)
WITH OPTIONS
(
    max_cpu_concurrency = 7,
    max_scheduling_priority = 70,
    max_tier_priority = 10
)

ALTER RESOURCE GROUP

Any of the following facets of a resource group can be altered, either individually or as a group:

  • Rank
  • Tier limits
  • Execution options
ALTER RESOURCE GROUP Syntax
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ALTER RESOURCE GROUP <resource group name>
[ RANK <FIRST | LAST | BEFORE <group name> | AFTER <group name>> ]
[
    TIER LIMITS
    (
        <tier name> USING (<tier property name> = <tier property value>[,...]),
        ...
        <tier name> USING (<tier property name> = <tier property value>[,...])
    )
]
[ WITH OPTIONS (<resource property name> = <resource property value>[,...]) ]
ParametersDescription
<resource group name>Name of the resource group to alter.
RANK

Designation of where in the ordering of applicable resource groups this one should exist. For a given set of resource groups, the one that is ranked before all the others will be used.

RANK designations include:

KeywordDescription
FIRSTMake this resource group the new first one in the ordering.
LASTMake this resource group the new last one in the ordering.
BEFORE <group name>Place this resource group before the one specified by group name in the ordering.
AFTER <group name>Place this resource group after the one specified by group name in the ordering.
TIER LIMITS

Optional indicator that a set of tier names and corresponding property assignments will follow.

Parameters for each tier assignment are as follows:

KeywordDescription
tier name

Name of the tier to which limits will be assigned:

NameDescription
VRAMUpdate the VRAM tier.
RAMUpdate the RAM tier.
tier property name

Name of the tier property to which a limit will be assigned:

PropertyDescription
max_memoryMaximum amount of memory per rank that can be used in the associated tier.
tier property valueValue to assign the corresponding tier property.
WITH OPTIONS

Optional indicator that a comma-delimited list of resource group property option/value assignments will follow.

See Resource Group Options for the complete list of options.


Resource Group Options

The following options can be specified to further modify a resource group configuration.

OptionDescription
max_cpu_concurrencyMaximum number of simultaneous threads that will be used to execute a request. Must be >= 4.
max_dataMaximum amount of data, in bytes, that can be used by all database objects within this group; for example, a max_data of 1,000,000,000 would limit a user with this resource group to a total of 1GB of data usage across all tables, views, graphs, etc., system wide.
max_scheduling_priorityMaximum scheduling priority of a task.
max_tier_priorityMaximum eviction priority of a tiered object.
persistWhether to save this change to the database configuration so that it will stay in effect after a database restart. Default is true.

Examples

For example, to alter an existing memory_and_execution resource group, moving it to the highest ranking, while assigning new limits for the RAM tier and max_cpu_concurrency & max_scheduling_priority options, but leaving other existing settings untouched:

ALTER RESOURCE GROUP Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ALTER RESOURCE GROUP memory_and_execution
RANK FIRST
TIER LIMITS
(
    RAM USING (max_memory = 214748364800)
)
WITH OPTIONS
(
    max_cpu_concurrency = 9,
    max_scheduling_priority = 90
)

DROP RESOURCE GROUP

An existing user-defined resource group can be removed from the system, which will also dissociate the group from any users or roles to which it was assigned.

DROP RESOURCE GROUP Syntax
1
DROP RESOURCE GROUP <resource group name>

For example, to remove the unlimited resource group:

DROP RESOURCE GROUP Example
1
DROP RESOURCE GROUP unlimited

SHOW RESOURCE GROUP

The configuration of any resource group can be shown, in tabular form. The configuration for all resource groups in the system can also be shown with a single command.

SHOW RESOURCE GROUP Syntax
1
SHOW RESOURCE GROUP < <resource group name> | ALL >

For example, to show the configuration of the memory_and_execution resource group:

SHOW RESOURCE GROUP Example
1
SHOW RESOURCE GROUP memory_and_execution

To show the configuration of all resource groups:

SHOW RESOURCE GROUP (All Groups) Example
1
SHOW RESOURCE GROUP ALL