v.25.8New Feature

Enable preemptive CPU scheduling

Server setting cpu_slot_preemption enables preemptive CPU scheduling for workloads and ensures max-min fair allocation of CPU time among workloads. New workload settings for CPU throttling are added: max_cpus, max_cpu_share and max_burst_cpu_seconds. More details: https://clickhouse.com/docs/operations/workload-scheduling#cpu_scheduling. #80879 (Sergei Trifonov).
Introduces the cpu_slot_preemption server setting to enable preemptive CPU scheduling, along with new workload settings max_cpus, max_cpu_share, and max_burst_cpu_seconds for fine-grained CPU throttling in ClickHouse workloads.

Why it matters

This feature provides max-min fair allocation of CPU time among workloads by allowing the server to preempt CPU slots. It solves the problem of CPU resource contention and improves workload scheduling fairness and efficiency, ensuring workloads can be throttled and controlled precisely based on CPU usage.

How to use it

Enable preemptive CPU scheduling by setting cpu_slot_preemption on the server. Configure workload CPU limits using the new settings max_cpus, max_cpu_share, and max_burst_cpu_seconds in the workload configurations. For example:

SET cpu_slot_preemption = 1;
-- Then configure workload with max_cpus, max_cpu_share, max_burst_cpu_seconds