Repository navigation
docs(audits): scope daemon thread-per-connection ceiling and admission gap (#1673) - #4023
Merged
Merged
Conversation
…n gap (#1673) Distil the existing thread-per-connection analysis into a single-page audit with a concrete threshold table (100/1k/10k) and one recommendation: a daemon-level max-connections admission cap that reads the already-wired ConnectionCounter before thread::spawn and returns upstream's @error: max connections (N) reached.
1 of 4 tasks
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…n gap (#1673) (#4023) Distil the existing thread-per-connection analysis into a single-page audit with a concrete threshold table (100/1k/10k) and one recommendation: a daemon-level max-connections admission cap that reads the already-wired ConnectionCounter before thread::spawn and returns upstream's @error: max connections (N) reached.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…n gap (#1673) (#4023) Distil the existing thread-per-connection analysis into a single-page audit with a concrete threshold table (100/1k/10k) and one recommendation: a daemon-level max-connections admission cap that reads the already-wired ConnectionCounter before thread::spawn and returns upstream's @error: max connections (N) reached.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…n gap (#1673) (#4023) Distil the existing thread-per-connection analysis into a single-page audit with a concrete threshold table (100/1k/10k) and one recommendation: a daemon-level max-connections admission cap that reads the already-wired ConnectionCounter before thread::spawn and returns upstream's @error: max connections (N) reached.
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
crates/daemon/src/daemon/sections/server_runtime/(accept_loop, connection, connection_counter, listener, workers) against upstreamsocket.c:start_accept_loop(lines 533-624) andclientserver.c:744-756.docs/audits/daemon-thread-per-connection-1673.md: a single-page audit covering thread creation cost, stack budget (Rust default 2 MiB, glibc reserves 8 MiB; nothread::Builder::stack_sizeanywhere in the daemon), admission control (listen backlog ataccept_loop.rs:139, no daemon-level concurrency cap), worker lifecycle (joined not detached; O(n) reap walk per accept), shared state, and the fork-vs-thread tradeoff.RLIMIT_NOFILEdefault 1024 and pays O(n) reap), 10 k broken (RLIMIT_NPROC, OOM,clone3: EAGAIN).max connectionsadmission cap that reads the already-wiredConnectionCounter::active()(connection_counter.rs:32-35, currently#[allow(dead_code)]) beforethread::spawnatconnection.rs:121and returns@ERROR: max connections (N) reachedmatching upstreamclientserver.c:752. Smallest change, prerequisite for every other mitigation.docs/audits/daemon-thread-per-connection.md,docs/audits/daemon-thread-per-connection-scalability.md, the async listener RFC (Accept quoted fallback override values #1934), the benchmark task (Optimize rolling checksum bulk rolls #1933), and the completed chroot audit (Fix cross-platform release packaging #2129).Docs-only. No code changes.
Test plan
cargo fmt --all -- --check(no source changed, expected pass)cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings(no source changed, expected pass)