Purpose
You can use this statement to create a resource unit, which defines the specifications of hardware resources and is used to allocate hardware resources to tenants.
Unit specifications specify the total amount of allocatable resources on a single server in a single zone. A tenant can store data on a server only when the tenant has a resource unit on the server.
The total amount of resources allocated to a tenant is calculated as follows: Unit specifications × Unit quantity.
Syntax
CREATE RESOURCE UNIT unit_name
MAX_CPU [=] cpu_num,
MAX_MEMORY [=] mem_size,
MAX_IOPS [=] iops_num,
MAX_DISK_SIZE [=] disk_size,
MAX_SESSION_NUM [=] session_num,
[MIN_CPU [=] cpu_num,]
[MIN_MEMORY [=] mem_size,]
[MIN_IOPS [=] iops_num] ;
Parameters
| Parameter | Description |
|---|---|
| MAX_CPU | The maximum number of CPU cores for the resource unit. |
| MAX_MEMORY | The maximum memory size, in bytes. Value range: [1073741824, +∞). Default value: 5368709120, that is 5 GB. |
| MAX_IOPS | The maximum IOPS. Value range: [128, +∞). |
| MAX_DISK_SIZE | The maximum disk size, in bytes. Value range: [536870912, +∞). Minimum value: 512 MB. |
| MAX_SESSION_NUM | The maximum number of sessions. Value range: [64, +∞). |
| MIN_CPU | The minimum number of CPU cores. |
| MIN_MEMORY | The minimum memory size. |
| MIN_IOPS | The minimum IOPS. |
Examples
Create a resource unit named unit1 with the following specifications: 4 CPU cores, 5 GB memory, IOPS of 128, 10 GB disk size, and at most 64 sessions.
obclient> CREATE RESOURCE UNIT UNIT1 MAX_CPU 4, MAX_MEMORY '5G', MAX_IOPS 128,MAX_DISK_SIZE '10G', MAX_SESSION_NUM 64, MIN_CPU=4, MIN_MEMORY= '5G', MIN_IOPS=128