v.23.5New Feature
Add Memory Tracking for Background Tasks in ClickHouse
Add MemoryTracker for the background tasks (merges and mutation). Introducesmerges_mutations_memory_usage_soft_limitandmerges_mutations_memory_usage_to_ram_ratiosettings that represent the soft memory limit for merges and mutations. If this limit is reached ClickHouse won't schedule new merge or mutation tasks. AlsoMergesMutationsMemoryTrackingmetric is introduced to allow observing current memory usage of background tasks. Resubmit #46089. Closes #48774. #48787 (Dmitry Novik).
Why it matters
To prevent excessive memory consumption by background merge and mutation tasks, enabling better resource control and system stability by stopping task scheduling when memory usage exceeds configured soft limits.How to use it
Configure the new settingsmerges_mutations_memory_usage_soft_limit and merges_mutations_memory_usage_to_ram_ratio to set soft memory limits for merges and mutations. Monitor the MergesMutationsMemoryTracking metric to observe current memory usage of these background tasks.