Skip to main content
These settings configure the ClickHouse server and are autogenerated from ClickHouse source.

concurrent_threads_lazy_allocation

Controls how CPU slots are allocated to queries. When true (default), a query starts with one CPU slot and requests additional slots from the scheduler only when its pipeline actually pushes more parallelizable work. This avoids the situation where a query reserves up to max_threads slots but only ever uses a fraction of them, starving other concurrent queries. Applies both to concurrency control and to the preemptive CPU scheduler for workloads. When false, the query requests all max_threads slots up front at start.

concurrent_threads_scheduler

The policy on how to perform a scheduling of CPU slots specified by concurrent_threads_soft_limit_num and concurrent_threads_soft_limit_ratio_to_cores. Algorithm used to govern how limited number of CPU slots are distributed among concurrent queries. Scheduler may be changed at runtime without server restart. Possible values:
  • round_robin — Every query with setting use_concurrency_control = 1 allocates up to max_threads CPU slots. One slot per thread. On contention CPU slot are granted to queries using round-robin. Note that the first slot is granted unconditionally, which could lead to unfairness and increased latency of queries having high max_threads in presence of high number of queries with max_threads = 1.
  • fair_round_robin — Every query with setting use_concurrency_control = 1 allocates up to max_threads - 1 CPU slots. Variation of round_robin that does not require a CPU slot for the first thread of every query. This way queries having max_threads = 1 do not require any slot and could not unfairly allocate all slots. There are no slots granted unconditionally.
  • max_min_fair — Every query with setting use_concurrency_control = 1 allocates up to max_threads - 1 CPU slots. Similar to fair_round_robin, but released slots are always granted to the query with the minimum number of currently allocated slots. This provides better fairness under high oversubscription, where many queries compete for limited CPU slots. Short-running queries are not penalized by long-running queries that have accumulated more slots over time.

concurrent_threads_soft_limit_num

The maximum number of query processing threads, excluding threads for retrieving data from remote servers, allowed to run all queries. This is not a hard limit. In case if the limit is reached the query will still get at least one thread to run. Query can upscale to desired number of threads during execution if more threads become available.
A value of 0 (default) means unlimited.

concurrent_threads_soft_limit_ratio_to_cores

Same as concurrent_threads_soft_limit_num, but with ratio to cores.
Last modified on July 23, 2026