v.19.11New Feature

Added Os_thread_priority Setting That Allows to Control the "nice" Value of Query Processing Threads That Is Used by OS to Adjust Dynamic Scheduling Priority

Added os_thread_priority setting that allows to control the "nice" value of query processing threads that is used by OS to adjust dynamic scheduling priority. It requires CAP_SYS_NICE capabilities to work. This implements #5858 #5909 (alexey-milovidov)
Added the os_thread_priority setting to control the "nice" value of query processing threads, allowing adjustment of their dynamic scheduling priority by the operating system.

Why it matters

The feature addresses the need to manage CPU scheduling priorities for query processing threads in ClickHouse. By setting the thread priority, users can influence how the OS allocates CPU time, which can improve performance balancing and resource management on multi-tenant or resource-constrained systems. It requires the CAP_SYS_NICE capability to function.

How to use it

Users can enable or adjust this feature by setting the os_thread_priority parameter in the ClickHouse server or client configuration files or via session settings. The value sets the "nice" level for query processing threads (typically a numeric value where lower is higher priority). Ensure that the ClickHouse process has the CAP_SYS_NICE capability to apply this setting successfully.