3x-ui/internal
BlindMaster24 4a8fdceed6
perf(nodes): reuse one pooled client per node instead of rebuilding it (#6548)
* perf(nodes): reuse one pooled client per node instead of rebuilding it

The heartbeat probe asks for a client every 5s per node, and for skip, pin and
mtls modes HTTPClientForNode built a client with its own transport each time:
every tick paid a full TCP+TLS handshake per node, which is the CPU a 100-node
fleet reports. Cache the client per node identity, close the previous one when
that identity changes, and raise the idle pool caps above any real fleet size
so a node's connection survives to its next tick.

* perf(nodes): keep one client per node in the pooled cache

Round-1 findings on this PR. The eviction dropped only entries whose key did not
start with the current identity, so every proxy variant of that identity stayed
for the life of the process. That variant is often a fresh loopback port:
withOutboundBridge mints one per call and tears the bridge down on return, so
each operator "test node" or remote-inbounds action added a client whose key can
never be hit again, and a node switched to verify mode orphaned its old entry by
returning before the loop. Replacing that filter with one entry per node bounds
the cache at the fleet size, and the verify-mode return now clears the node too.

TestHTTPClientForNodeKeepsOneClientPerNode fails without this -- watched red,
"2, want 1" -- and pins the verify-mode cleanup on the same cache.

* style(nodes): keep the eviction comment inside the two-line cap
2026-09-15 15:29:49 +03:00
..
amneziawg fix(amneziawg): read the outbound pseudo-protocol id like the core (#6531) 2026-09-15 08:23:18 +03:00
amneziawgnet fix(amneziawg): wrap the relay port window instead of refusing ids past it (#6539) 2026-09-15 10:07:14 +03:00
config v3.8.0 2026-09-14 19:11:03 +02:00
crypto/nodetoken fix(nodetoken): make the corrupt-ciphertext test corrupt deterministically (#6520) 2026-09-14 12:08:11 +02:00
database fix(xray): read an outbound protocol id the way the core does (#6521) 2026-09-14 19:52:27 +03:00
eventbus chore: refresh dependencies, fix Linux tool tasks, modernize Go idioms 2026-07-25 16:08:09 +02:00
logger fix(inbounds): apply runtime changes after the DB commit (#5768) 2026-07-08 22:12:28 +02:00
mtproto fix(mtproto): synchronize child-process lifecycle (#6141) 2026-07-29 20:56:26 +02:00
pia chore(build): bump Go toolchain to 1.27.0 2026-08-23 21:57:03 +02:00
sub feat(sub): add opt-in month-end expiry presentation (#6517) 2026-09-14 12:10:25 +02:00
tuic fix(tuic): evict the oldest relay flow instead of refusing new clients 2026-09-12 10:40:41 +02:00
tunnelmonitor style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
util fix(link): restore mKCP seed and headerType on share-link import (#6480) 2026-09-13 22:28:13 +02:00
web perf(nodes): reuse one pooled client per node instead of rebuilding it (#6548) 2026-09-15 15:29:49 +03:00
xray feat(sub): let the panel set the JSON subscription DNS servers (#6485) 2026-09-13 11:51:56 +02:00