feat(cli): add --rayon-threads and --tokio-threads tunables#3747
Merged
Conversation
Expose two new local-only worker pool tunables on the CLI: - --rayon-threads=N caps rayon's global pool, applied via ThreadPoolBuilder::build_global() before any rayon work begins. - --tokio-threads=N is plumbed through ClientConfig so async transports (gated behind the async feature) can honour it. Both flags reject 0 and values exceeding 1024. Values flow from ParsedArgs through ConfigInputs into ClientConfig, with NonZeroUsize storage on the config side. Local-only - neither flag is forwarded to the remote peer.
6b21001 to
9e45503
Compare
oferchen
added a commit
that referenced
this pull request
May 18, 2026
* feat(cli): add --rayon-threads and --tokio-threads tunables Expose two new local-only worker pool tunables on the CLI: - --rayon-threads=N caps rayon's global pool, applied via ThreadPoolBuilder::build_global() before any rayon work begins. - --tokio-threads=N is plumbed through ClientConfig so async transports (gated behind the async feature) can honour it. Both flags reject 0 and values exceeding 1024. Values flow from ParsedArgs through ConfigInputs into ClientConfig, with NonZeroUsize storage on the config side. Local-only - neither flag is forwarded to the remote peer. * fix(deps): regenerate Cargo.lock for rayon workspace dep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--rayon-threads=Nand--tokio-threads=NCLI tunables (1-1024) for capping the local rayon worker pool and async tokio runtime worker count.--rayon-threadscallsrayon::ThreadPoolBuilder::build_global()at the top of the execute path before any rayon work begins; failure to install (e.g. pool already initialised) is reported as a non-fatal warning so transfers continue with the default thread count.--tokio-threadsis plumbed throughParsedArgs->ConfigInputs->ClientConfigBuilder->ClientConfigso async transports (gated behind theasyncfeature) can honour the cap when they are constructed.0and values exceeding1024; non-numeric input is rejected with the offending token quoted in the error.Test plan
cargo nextest run -p cli --all-features -E 'test(rayon_threads) | test(tokio_threads)'cargo nextest run -p core --all-features -E 'test(rayon_threads) | test(tokio_threads)'