v.18.16Improvement

min_merge_bytes_to_use_direct_io Default Set to 10 GiB in ClickHouse

The min_merge_bytes_to_use_direct_io option is set to 10 GiB by default. A merge that forms large parts of tables from the MergeTree family will be performed in O_DIRECT mode, which prevents excessive page cache eviction. #3504
Introduces the min_merge_bytes_to_use_direct_io setting which enables large merges in MergeTree tables to use O_DIRECT mode, bypassing the page cache.

Why it matters

This feature addresses the issue of excessive page cache eviction during large merges in tables of the MergeTree family by performing merges in direct I/O mode once they exceed a specified size threshold. It improves system performance and stability by reducing cache pollution.

How to use it

Users can enable or adjust this behavior by setting the min_merge_bytes_to_use_direct_io option in the configuration or via a session setting. By default, it is set to 10 GiB, meaning merges larger than this threshold will automatically use O_DIRECT.