Updated on 2025-05-29 GMT+08:00

Multi-Tenant Databases

enable_mtd

Parameter description: Specifies whether to enable the kernel multi-tenancy function.

Parameter type: Boolean.

Unit: none

Value range:

  • on: enables the kernel multi-tenancy function.
  • off: disables the kernel multi-tenancy function.

Default value: off

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Whether to enable the multi-tenancy function is determined during instance installation. You are advised not to change the value of this parameter.

Risks and impacts of improper settings: If this parameter is modified, the instance may fail to be started.

backend_resource_attr

Parameter description: Specifies the detailed attributes of the backend thread CPU function and modifies the share and quota values of the backend thread Cgroup. This parameter takes effect only after enable_mtd is enabled and can be accessed only by the SYSADMIN user.

Parameter type: string.

Unit: none

Value range: This parameter consists of 'backend_total_share, backend_total_quota, backend_share, vacuum_share'. The meanings of the four parts are as follows:

  • backend_total_share: percentage of backend threads to the entire instance.

    Value range: 1 to 99. The default value is 40, indicating that the total percentage of backend threads is 40%.

    You are advised to set the percentage of backend threads based on the hardware configuration. The sum of the backend thread ratio and tenant ratio remains 100%.

    According to the formula Value of backend_total_share = 100 x x/(x + ceil(Number of CPU cores in the cluster x 1.1), x x 1024 is the share value configured for the backend Cgroup.

    For example, if backend_total_share is 40 and the number of CPU cores is 16, the share value is 12288.

  • backend_total_quota: total number of CPUs that can be used by backend threads.

    Value range: 0 to the number of CPU cores of the database instance. 0 indicates that the CPU upper limit is not controlled for backend threads. If the value is greater than 0, the number of CPU cores that can be used by backend threads cannot exceed the value of this parameter.

  • backend_share: weight of backend threads except the vacuum thread. For example, if backend_share is set to 80, the effective value of share in the DefaultBackend Cgroup is 80 x 1024.

    Value range: 1 to 99.

  • vacuum_share: thread weight of vacuum. For example, if vacuum_share is set to 20, the effective value of share in the vacuum Cgroup is 20 x 1024.

    Value range: 1 to 99.

Default value: "40, 0, 80, 20"

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: "40.round(Number of cores x 0.05).80.20" (196-core CPU/1536 GB memory, 128-core CPU/1024 GB memory, 104-core CPU/1024 GB memory, 96-core CPU/1024 GB memory, 96-core CPU/768 GB memory, 80-core CPU/640 GB memory, 64-core CPU/512 GB memory, 60-core CPU/480 GB memory, 32-core CPU/256 GB memory); "40.1.80.20" (16-core CPU/128 GB memory).

Risks and impacts of improper settings: If share or quota is set to a small value, the time slice used by the CPU of the backend thread is reduced. As a result, the backend thread service cannot be processed in a timely manner, and tenants' public services wait. If the values are too large, the available CPU resources of the tenant decrease.

pdb_transaction_read_only

Parameter description: Specifies whether the current PDB transaction is a read-only transaction.

Parameter type: Boolean.

Unit: none

Value range:

  • on: The current PDB transaction is in read-only state.
  • off: The current PDB transaction is not in read-only state.

Default value: off

Setting method: This is a PDB_SIGHUP parameter. Set it based on instructions provided in 16.2-Table 1 GUC parameters.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: If this parameter is set to on, DML operations and transactions cannot be written.

pdb_logical_decoder_max_memory

Parameter description: Specifies the maximum memory quota that can be used by logical decoding tasks.

Parameter type: integer.

Unit: KB

Value range: –1 to 2147483647

Default value: –1, indicating no control. All memory quotas of the PDB can be used.

Setting method: This is a PDB_SIGHUP parameter. Set it based on instructions provided in 16.2-Table 1 GUC parameters. For example, if the value is 131072 without a unit, pdb_logical_decoder_max_memory indicates 131072 KB. If the value is 128MB, pdb_logical_decoder_max_memory indicates 128 MB. The unit must be KB, MB, or GB if required.

Setting suggestion: You are advised to set this parameter to 50% of max_dynamic_memory. max_dynamic_memory indicates the total dynamic memory of the current PDB, which can be obtained from the gs_resource_plan_directives table.

Risks and impacts of improper settings: If this parameter is set to a small value, logical decoding tasks will fail frequently. If this parameter is set to a large value, the available memory of the job thread decreases and the TPS is too low.

To ensure the performance of logical decoding, logical decoding checks the dynamic memory upper limit every second. Therefore, the memory used by the logical decoding task may exceed the value of pdb_logical_decoder_max_memory in a short window period.

max_logical_decoder_tasks

Parameter description: Specifies the maximum number of concurrent decoding tasks in an instance. In a multi-tenant database, the number of tasks is shared by the non-PDB and PDB. This parameter takes effect only in a multi-tenant database.

Parameter type: integer.

Unit: none

Value range: 0 to 1024

Default value: 20

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in 16.2-Table 1 GUC parameters.

Setting suggestion: In a multi-tenant database, you are advised to set this parameter to a value greater than or equal to 128 to ensure that each tenant can start a decoding task.

Risks and impacts of improper settings: In a multi-tenant database, if the value is less than 128, not all tenants can start decoding tasks. If the value is too large, more resources are required for starting parallel decoding tasks, which increases the machine load to some extent.