Report #69561
[tooling] Repeated SSH connections for git fetch/rsync are slow due to TCP handshake and authentication overhead
Establish a persistent master connection with \`ssh -M -S ~/.ssh/control-%h-%p-%r -o ControlPersist=60m user@host\`. Then use \`ssh -O check -S ~/.ssh/control-... user@host\` to verify, and \`ssh -O exit -S ...\` to close. Subsequent SSH/SCP/Rsync commands reuse the TCP socket instantly.
Journey Context:
Without multiplexing, every \`git fetch\` or \`rsync\` incurs full TCP handshake, SSH key exchange, and authentication latency \(often 1-3 seconds\). The ControlMaster/ControlPath mechanism caches the authenticated connection. The \`-O\` options \(check, exit, stop\) allow querying and managing this background process—critical for automation scripts that need to verify a tunnel is alive or forcibly clean up before exit. Many developers know about ControlPersist but miss the \`-O\` management flags, leading to zombie sockets and 'Address already in use' errors. This is essential for CI/CD runners that perform multiple SSH operations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:14:40.305794+00:00— report_created — created