Repository navigation
splithttp: bound physical H2 carriers for maxConnections - #6644
kaiserproger wants to merge 1 commit into
Conversation
2a81d0d to
93f3fd8
Compare
|
Additional production-only validation after removing all auxiliary canary processes/services:
After the stress test the production reuse window was restored to I also found and removed stale auxiliary |
|
我觉得没啥必要做这么严 |
|
Thanks — you were right about the simpler mechanism. I tested the stock v26.7.28 client in the real deployment by changing only the peer-advertised HTTP/2 stream limit on nginx:
So for my deployment raising the peer stream limit is enough and keeping draining carriers alive is indeed the right behavior. I am reverting the custom Xray build in production and keeping stock XMUX with time-based rotation. Thanks for pointing this out. |
Summary
Make XHTTP
xmux.maxConnectionsbehave like a bounded physical HTTP/2 carrier pool instead of only bounding logicalhttp2.Transportinstances.When
maxConnectionsis configured for HTTP/2, this change:http2.ClientConnto eachXmuxClient, so one logical carrier cannot silently create additional TCP connections;Nactive carriers and at most one planned draining carrier while long-lived flows finish.There is no XHTTP wire-format or server-side protocol change. Non-
maxConnectionsbehavior keeps the existing transport path.Why
There are two independent layers of connection pooling today:
maxConnectionsXmuxClientobjects.XmuxClientuses anhttp2.Transport, which is itself allowed to create multiple physical H2/TCP connections.There is also a rotation issue: when an XMUX client reaches its reuse/request/time limit, it is removed from the active slice even when pinned proxy flows are still running. The replacement is then created while the old transport is still draining.
For configurations that use
maxConnectionsas an outer TCP/H2 recovery-domain budget, the number therefore does not directly describe the number of physical carrier connections.Rotation behavior
For fixed
maxConnections = N:Ncarriers;ClientConn;Thus normal planned rotation is bounded to
N active + at most 1 drainingphysical carrier.Unexpected connection failures/GOAWAY still prioritize recovery rather than waiting for planned rotation.
Reproducer / live validation
I ran stock v26.7.28 and the patched build as two separate client processes with the same outbound configuration:
maxConnections = 8hMaxReusableSecs = 10-12(intentionally shortened for the test)Result after the second group connected:
All new requests succeeded in both cases. The patched result is the intended 8 active + 1 draining make-before-break state.
A separate throughput check used an incompressible random file and verified the actual HTTP 206 byte counts. One run produced:
The throughput differences are within normal network variance; the relevant result is that bounding the physical pool did not introduce an aggregate-throughput regression in this test.
Tests
Added tests cover:
MaxConcurrentStreams = 32;maxConnectionspools.Validation on current
main: