@@ -169,15 +169,30 @@ physical interface, so tor's outbound TLS never loops back into the tunnel.
169169### Circuit health monitor
170170
171171While Tor is up, TorJet watches the conflux legs via the control port. Every
172- 20 s it asks tor for ` circuit-status ` , prints each leg (` leg <id> RTT <ms> ` )
173- and closes the weakest half (rounded up) of the legs whose RTT is above
174- 1500 ms - with 4 slow legs the 2 weakest are closed in one pass
175- (` CLOSECIRCUIT ` ). Tor builds replacement legs and conflux migrates streams
176- onto them, so slow, high-latency circuits get replaced automatically instead of
177- dragging the connection down. A 60 s cooldown between closes keeps the circuit
178- set stable (relaxed during tunnel warmup). Disable it with
179- ` --no-circuit-watch ` ; tune it with ` --watch-rtt <ms> ` ,
180- ` --watch-interval <seconds> ` and ` --watch-cooldown <seconds> ` .
172+ 20 s it asks tor for the conflux set list (` CONFLUX QUERY ` ) and prunes low
173+ quality legs so tor rebuilds them with fresh circuits:
174+
175+ - a linked leg is ** weak** when its RTT is at/above an absolute threshold
176+ (` --watch-rtt ` , default 1000 ms) or it is clearly slower than the best leg of
177+ its own set (` >= --watch-rtt-floor ` ms and ` >= --watch-factor ` times the set
178+ best, defaults 400 ms and 2.0x);
179+ - a leg must stay weak for ` --watch-strikes ` consecutive passes (default 2)
180+ before it is closed, so a single RTT spike never prunes a healthy leg;
181+ - the best (lowest RTT) leg of each set is never closed, and a set is never
182+ pruned below ` --watch-min-legs ` (default 2);
183+ - legs stuck ** unlinked** for ` --watch-unlinked-strikes ` passes (default 4)
184+ AND older than ` --watch-unlinked-grace ` seconds (default 120) are closed as
185+ dead weight, but never during tunnel warmup when everything is still
186+ building;
187+ - at most ` --watch-max-per-pass ` legs (default 6) are closed per pass so
188+ replacement builds don't pile up.
189+
190+ tor launches a replacement leg for every closed leg (sets below the configured
191+ ` ConfluxNumLegs ` target are also topped up with ` CONFLUX ADD ` ), and conflux
192+ migrates streams onto the fresh circuits. A 60 s cooldown between closes keeps
193+ the circuit set stable (relaxed during tunnel warmup). Disable it with
194+ ` --no-circuit-watch ` ; tune it with ` --watch-rtt <ms> ` , `--watch-interval
195+ <seconds >` , ` --watch-cooldown <seconds >` and the other ` --watch-* ` flags.
181196
182197### Tunnel warmup
183198
0 commit comments