Modify minor compaction settings

2024-12-02 03:48:29  Updated

This topic introduces the minor compaction parameters and describes how to set these parameters.

Minor compaction parameters

Parameter Description Default value Value range
minor_compact_trigger The number of SSTables for triggering a minor compaction. It is a tenant-level parameter. 2 [0, 16]
freeze_trigger_percentage The maximum percentage of memory space used by the MemStore of the tenant to trigger a minor freeze. This is a tenant-level parameter. 20 (0, 100)
memstore_limit_percentage The percentage of MemStore memory to the total memory of the tenant. It is a cluster-level parameter.

Note

Starting from OceanBase Database V4.3.0, the V4.3.x series provide the tenant-level hidden parameter _memstore_limit_percentage, which specifies the percentage of the memory that can be occupied by the MemStore to the total available memory of a tenant. The parameter has the same feature and default value as the cluster-level parameter memstore_limit_percentage. Take note of the following considerations when you configure these two parameters:

  • If you set either _memstore_limit_percentage or memstore_limit_percentage to a non-default value, the value prevails.
  • If you set both _memstore_limit_percentage and memstore_limit_percentage to non-default values, the value of _memstore_limit_percentage prevails.
  • If neither is configured or both are set to default values, the system adopts the following adaptive strategy:
    • For a tenant with a memory of 8 GB or less, the percentage of the memory that can be occupied by MemStore is 40%.
    • For a tenant with a memory of more than 8 GB, the percentage of the memory that can be occupied by MemStore is 50%.
0 [0, 100)

Modify minor compaction parameters by using SQL statements

  1. Log in to the database as a tenant administrator.

  2. Execute the following sample statements to modify minor compaction parameters:

    obclient> ALTER SYSTEM SET minor_compact_trigger=2;
    
    obclient> ALTER SYSTEM SET major_compact_trigger=10;
    
    obclient> ALTER SYSTEM SET freeze_trigger_percentage=20;
    
    obclient> ALTER SYSTEM SET memstore_limit_percentage=50;
    
  3. After the parameters are modified, you can execute the SHOW PARAMETERS statement to check whether the modification is successful.

    Here are some examples:

    obclient> SHOW PARAMETERS LIKE 'minor_compact_trigger';
    
    obclient> SHOW PARAMETERS LIKE 'major_compact_trigger';
    
    obclient> SHOW PARAMETERS LIKE 'freeze_trigger_percentage';
    
    obclient> SHOW PARAMETERS LIKE 'memstore_limit_percentage';
    

Contact Us