Updated on 2024-12-18 GMT+08:00

Disk Caching

The following parameters are supported only by clusters of version 9.1.0 or later.

enable_disk_cache

Parameter description: Specifies whether to enable file caching. Setting this parameter to on only takes effect when enable_aio_scheduler is set to on and obs_worker_pool_size is greater than or equal to 4.

Type: USERSET

Value range: Boolean

Default value: off

enable_disk_cache_recovery

Parameter description: Specifies whether file caching can be restored when the cluster is restarted.

Type: USERSET

Value range: Boolean

Default value: off

disk_cache_block_size

Parameter description: Specifies the size of a single block cached in the file system, in KB.

Type: POSTMASTER

Value range: an integer ranging from 8 to 8 x 1024 x 1024 x 1024

Default value: 1MB

disk_cache_max_size

Parameter description: Specifies the total caching size of the file system, in KB.

Type: SIGHUP

Value range: an integer ranging from 1 GB to 1 PB

Default value: 1/3 of the EVS disk capacity

The EVS capacity is divided into two parts: 1/3 x 2 replicas are used to store local persistent data (such as column-store indexes, row-store tables, and local column-store tables), and the other 1/3 is reserved for cache.

disk_cache_max_open_fd

Parameter description: Specifies the maximum number of files that can be concurrently opened in the cache of the file system.

Type: POSTMASTER

Value range: an integer ranging from 0 to INT_MAX

Default value: 1000

disk_cache_a1out_min_ratio

Parameter description: Specifies the length ratio of the a1_out queue at its minimum in the LRU2Q algorithm cached in the file system (the actual minimum length of the queue is disk_cache_a1out_min_ratio x disk_cache_max_size).

Type: POSTMASTER

Value range: a double-precision floating-point number ranging from 0 to DOUBLE_MAX

Default value: 0.5

disk_cache_a1out_max_ratio

Parameter description: Specifies the length ratio of the a1_out queue at its maximum on the LRU2Q algorithm cached in the file system (the actual maximum length of the queue is disk_cache_a1out_max_ratio x disk_cache_max_size).

Type: POSTMASTER

Value range: a floating point number ranging from 0 to DOUBLE_MAX

Default value: 8

disk_cache_a1in_ratio

Parameter description: Specifies the length ratio of the a1_in queue of the LRU2Q algorithm cached in the file system.

Type: POSTMASTER

Value range: a floating point number ranging from 0 to 1

Default value: 0.25

disk_cache_base_paths

Parameter description: Specifies the path for storing cache files in file caching.

Type: POSTMASTER

Value range: a string

Default value: disk_cache

install_as_standby

Parameter description: Specifies whether the node is the standby one during startup.

Type: POSTMASTER

Value range: Boolean

on indicates setting the node as the standby one.

off indicates setting the node as the primary one.

Default value: off