Skip to content

docs(audits): daemon thread-per-connection scalability ceiling (#1673)#3895

Merged
oferchen merged 1 commit into
masterfrom
audits/daemon-thread-per-connection
May 7, 2026
Merged

docs(audits): daemon thread-per-connection scalability ceiling (#1673)#3895
oferchen merged 1 commit into
masterfrom
audits/daemon-thread-per-connection

Conversation

@oferchen
Copy link
Copy Markdown
Owner

@oferchen oferchen commented May 7, 2026

Summary

  • Replace docs/audits/daemon-thread-per-connection.md with a focused, 116-line static audit covering the daemon accept loop and connection lifecycle.
  • Cite the accept loop, worker spawn, and counter sites in crates/daemon/src/daemon/sections/server_runtime/, quantify per-session memory (BufferPool, ReorderBuffer, flist) and the ~30 k-thread Linux ceiling, and contrast oc-rsync's thread+catch_unwind model with upstream rsyncd's fork-per-conn process boundary.
  • Document failure modes (SYN flood, slowloris on auth-stalled connections, lock contention on shared module state, O(n) reap latency) and mitigations: async tokio listener (Accept quoted fallback override values #1934/Normalize quoted fallback keywords #1935), daemon-level max connections enforcement on the existing ConnectionCounter, connection rate limit, bounded worker pool, reduced stack size.

Test plan

  • Confirm the file is under 130 lines (wc -l).
  • Confirm cited line numbers still resolve in accept_loop.rs, connection.rs, workers.rs, connection_counter.rs.
  • CI: docs-only change, expect fmt/clippy/test workflows to pass without behavioural impact.

Replace the thread-per-connection audit with a focused 5-section
brief covering the accept loop in
crates/daemon/src/daemon/sections/server_runtime/accept_loop.rs,
the per-thread stack and per-session memory ceiling, the fork-vs-thread
trade vs upstream rsyncd, slowloris and lock-contention failure modes,
and the migration path through tokio listener (#1934/#1935),
daemon-level max_connections, and bounded worker pools.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 7, 2026
@oferchen oferchen merged commit 41e4edd into master May 7, 2026
8 checks passed
@oferchen oferchen deleted the audits/daemon-thread-per-connection branch May 8, 2026 03:47
oferchen added a commit that referenced this pull request May 18, 2026
#3895)

Replace the thread-per-connection audit with a focused 5-section
brief covering the accept loop in
crates/daemon/src/daemon/sections/server_runtime/accept_loop.rs,
the per-thread stack and per-session memory ceiling, the fork-vs-thread
trade vs upstream rsyncd, slowloris and lock-contention failure modes,
and the migration path through tokio listener (#1934/#1935),
daemon-level max_connections, and bounded worker pools.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant