v.20.4Improvement
Added max_server_memory_usage Setting and Deprecated max_memory_usage_for_all_queries
Added a settingmax_server_memory_usageto limit total memory usage of the server. The metricMemoryTrackingis now calculated without a drift. The settingmax_memory_usage_for_all_queriesis now obsolete and does nothing. This closes #10293. #10362 (alexey-milovidov)
Why it matters
This feature addresses the challenge of managing overall server memory consumption by providing a centralized memory usage limit. It enhances stability and resource control, preventing excessive memory usage that could degrade performance or cause failures. AccurateMemoryTracking metrics enable better monitoring and debugging of memory usage.How to use it
To enable this feature, set themax_server_memory_usage configuration option in the server settings to the desired memory limit value. The previous setting max_memory_usage_for_all_queries is now ignored and should be removed from configuration. Memory usage tracking improvements are applied automatically.