You can create a resource unit by using SQL statements.
Create a resource unit by using SQL statements
The resources that can be used by a tenant are restricted to the specified resource units. If the current resource units cannot meet the needs of the new tenant, you can create a resource unit.
The following is the syntax of the statement for creating a resource unit:
CREATE RESOURCE UNIT unitname
MAX_CPU [=] cpunum,
MAX_MEMORY [=] memsize,
MAX_IOPS [=] iopsnum,
MAX_DISK_SIZE [=] disksize,
MAX_SESSION_NUM [=] sessionnum,
[MIN_CPU [=] cpunum,]
[MIN_MEMORY [=] memsize,]
[MIN_IOPS [=] iopsnum] ;
Parameter description and value ranges:
The parameters in the syntax must be specified, including the CPU, memory, IOPS, disk size, and session number.
When you specify a value for a parameter, you can use a number without quotation marks ('), or a number and a unit enclosed in quotation marks (for example, '1T', '1G', '1M', or '1K').
For example, max_memory='10G' is equivalent to max_memory=10737418240. Note
We recommend that you do not enclose a number without a unit in quotation marks.
Value range of
MAX_MEMORY: [1073741824,+ ∞) in bytes. That is, the minimum value is 1 GB.Value range of
MAX_IOPS: [128,+ ∞).Value range of
MAX_DISK_SIZE: [536870912,+ ∞] in bytes. That is, the minimum value is 512 MB.Value range of
MAX_SESSION_NUM: [64,+ ∞).
Examples:
obclient> CREATE RESOURCE UNIT unit1 max_cpu 1, max_memory '1G', max_iops 128,max_disk_size '10G', max_session_num 64, MIN_CPU=1, MIN_MEMORY='1G', MIN_IOPS=128;
obclient> CREATE RESOURCE UNIT unit1 max_cpu 1, max_memory 1073741824, max_iops 128, max_disk_size 10737418240, max_session_num 64, MIN_CPU=1, MIN_MEMORY=1073741824, MIN_IOPS=128;
A resource unit is actually a template that can be used by different resource pools. For example, after you create resource unit unit1, you can use the resource configuration of unit1 to create resource pools pool1 and pool2.