This topic describes the minor compaction parameters and how to set them.
Minor compaction parameters
Parameter |
Description |
Default value |
Value range |
|---|---|---|---|
| minor_compact_trigger | A tenant-level parameter that specifies the threshold for the number of SSTables that triggers a minor compaction. | 2 | [0, 16] |
| freeze_trigger_percentage | A tenant-level parameter that specifies the threshold for the percentage of memory occupied by the tenant's MemStore. When this value is reached, a freeze is triggered. | 20 | (0, 100) |
| memstore_limit_percentage | A cluster-level parameter that specifies the percentage of a tenant's total memory allocated to its MemStore. | 0 | [0, 100) |
Note
You can configure the percentage of total memory that the tenant's MemStore occupies by using the tenant-level hidden parameter _memstore_limit_percentage. Except for the scope of application, its functionality and default value are the same as those of the cluster-level parameter memstore_limit_percentage. When configuring these two parameters, note the following:
- If only one of the values (non-default) of
_memstore_limit_percentageormemstore_limit_percentageis configured, the configured value (non-default) takes effect. - If both the tenant-level hidden parameter
_memstore_limit_percentage(non-default) and the cluster-level parametermemstore_limit_percentage(non-default) are configured, the value configured in_memstore_limit_percentagetakes effect. - If neither is configured, or both are configured with their default values, the system adopts the following adaptive policy:
- Tenants with 8 GB (actual memory) or less have a configured MemStore ratio of 40%.
- Tenants with more than 8 GB of memory have a configured MemStore ratio of 50%.
Modify minor compaction settings by using SQL statements
Log in to the database as a tenant administrator.
Execute the following statements respectively to modify the minor compaction settings.
Example:
obclient> ALTER SYSTEM SET minor_compact_trigger=2; obclient> ALTER SYSTEM SET freeze_trigger_percentage=20; obclient> ALTER SYSTEM SET memstore_limit_percentage=50;After the modification, you can execute the
SHOW PARAMETERSstatement to check whether the modification is successful.Example:
obclient> SHOW PARAMETERS LIKE 'minor_compact_trigger'; obclient> SHOW PARAMETERS LIKE 'freeze_trigger_percentage'; obclient> SHOW PARAMETERS LIKE 'memstore_limit_percentage';