Skip to content

Raise concurrent_threads_soft_limit_ratio_to_cores code default to 2 - #103446

Merged
alexey-milovidov merged 4 commits into
masterfrom
enable-concurrent-threads-scheduler
Apr 26, 2026
Merged

alexey-milovidov merged 4 commits into
masterfrom
enable-concurrent-threads-scheduler

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Apr 23, 2026 •

Copy link
Copy Markdown
Member

Align the in-code fallback of concurrent_threads_soft_limit_ratio_to_cores in src/Core/ServerSettings.cpp with the shipped programs/server/config.xml value, so both are 2.

Previously the code default was 0 (unlimited) while config.xml shipped 2, meaning the max_min_fair scheduler effectively had no cap for anyone running without the shipped config.xml.

Related history: #86516, #89542.

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Align the default of the server setting concurrent_threads_soft_limit_ratio_to_cores in code with the shipped config.xml value (2), so the default max_min_fair concurrent threads scheduler caps query processing threads at 2x cores out of the box even when the shipped config.xml is not used.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Bump the shipped default in `config.xml` from 2 to 10 and the in-code
fallback in `ServerSettings.cpp` from 0 to 10, so the concurrent
threads scheduler (`max_min_fair`) effectively caps the total number of
query processing threads at 10x the number of CPU cores out of the box.

Related: #86516, #89542.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@alexey-milovidov
alexey-milovidov requested a review from serxa April 23, 2026 15:37
@clickhouse-gh

clickhouse-gh Bot commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8b036d2]

Summary: ✅


AI Review

Summary

This PR changes the in-code default for concurrent_threads_soft_limit_ratio_to_cores from 0 to 2 to match the shipped config.xml default and make scheduler behavior consistent when that config is not used. The change is small, coherent, and does not introduce correctness, safety, or maintainability risks in the touched area.

ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Apr 23, 2026
Keep `programs/server/config.xml` at the existing `2` and align the
in-code fallback in `ServerSettings.cpp` with it.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@alexey-milovidov alexey-milovidov changed the title Raise concurrent_threads_soft_limit_ratio_to_cores default to 10 Raise concurrent_threads_soft_limit_ratio_to_cores code default to 2 Apr 23, 2026
@serxa serxa self-assigned this Apr 24, 2026
@clickhouse-gh

clickhouse-gh Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 83.70% 83.80% +0.10%
Functions 91.10% 91.10% +0.00%
Branches 76.20% 76.20% +0.00%

Changed lines: 100.00% (6/6) · Uncovered code

Full report · Diff report

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Apr 26, 2026
Merged via the queue into master with commit 65f8294 Apr 26, 2026
165 checks passed
@alexey-milovidov
alexey-milovidov deleted the enable-concurrent-threads-scheduler branch April 26, 2026 11:16
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants