Repository navigation
Conversation
|
改名 h2Params 吧,另外你这只给 listener 加了,client 不需要加吗?#6268 说的是 client 还有我觉得对于 server 和 client 还是改下默认值更好,之前多次提过 Golang h2 栈也算特征,XDRIVE 和 MASQUE 可能也得上 |
client 还有那个 http2.transport 的迁移问题 两边不共享参数名 所以得推迟一下 6268 的需求的是 服务端宣告小窗口 客户端收到之后限制这边的读取buffer 所以是服务端参数
都已经直接听端口提供服务了 下面的TLS Server都是go的 HTTP层再改参数会出四不像掩耳盗铃 所以我觉得应该都默认 |
|
先开放个自定义 另外关于客户端的 #6797 ,Go 1.27.4 后 core 内尽力去掉 |
… KeepAlive Ported from Jolymmiles/Xray-core (v26.10.28-1202, v26.11.1-1424) and XTLS/Xray-core#7295 for the VLESS inbound's xhttp-config: - h2-flow: the server role of the HTTP/2 flow governor, whose code was already here for the client. enabled turns it on per inbound; max-stream-receive-window and max-connection-receive-window set the upload windows (6 MiB by default with the governor); max-connection-send-window bounds what one connection's client holds of the server's data (4 MiB, -1 for no limit); queue-cuts (on) lets a download hold its rate beside other traffic (the fork's MetaCubeX#64). The governor sits above TLS and REALITY and shows the HTTP server a metacubex/tls connection as TLS, so ALPN and plaintext probes are answered as before. - h2-params: the server's HTTP/2 settings (max-concurrent-streams, frame size, windows, header tables, ping and write timeouts). A receive window in h2-flow overrides it; with the governor max-concurrent-streams is at most 4096, the streams it tracks. Both blocks are checked before any listener binds. - mux-keep-alive-secs and mux-keep-alive-bytes: a Mux.Cool server pokes a packet-up or stream-up downlink that has carried nothing for that long with a padded KeepAlive frame, which every client discards, so CDNs and reverse proxies do not cut it as idle. Off by default; stream-one is never poked. The poke loop ends with the carrier and its close does not wait for it.
Upstream's XHTTP h2Params (XTLS#7295) took field 30 of the splithttp Config, which the fork's muxKeepAliveSecs held. The fork's fields move to 100-102, as in Jolymmiles/Xray-core, so upstream's next numbers stay free; a protobuf config built against the old numbers must be regenerated, JSON configs are unaffected. On the server h2Params is the base HTTP/2 config: a receive window set in h2Flow overrides it, and with the governor on its defaults fill a window neither sets. A governed server rejects MaxConcurrentStreams above the streams the governor tracks. h2Params is parsed before the listener binds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…iew fixes Upstream's XHTTP h2Params (XTLS/Xray-core#7295) took field 30 of the splithttp Config and changed the lines where the server builds its HTTP/2 config, so patches/xhttp-flow stopped applying from the first patch on and the stable and alpha builds stopped at their patch test. The series is rebased onto v26.10.31 as in the mux-ka fork's v26.10.31-h2Flow: h2Params is the base of a governed server's HTTP/2 config, a window set in h2Flow overrides it, and the fork's fields take 100-102 (muxKeepAliveSecs, muxKeepAliveBytes, h2Flow). Two fixes from a review follow: a download the server ended no longer lifts the connection's send window, and pi forgets its last error outside pi. Checked as Dockerfile-release applies them, on a clean v26.10.31: every patch applies, the hooks are found, the flow job's tests and the full splithttp, infra/conf and common/mux tests pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… KeepAlive Ported from Jolymmiles/Xray-core (v26.10.28-1202, v26.11.1-1424) and XTLS/Xray-core#7295 for the VLESS inbound's xhttp-config: - h2-flow: the server role of the HTTP/2 flow governor, whose code was already here for the client. enabled turns it on per inbound; max-stream-receive-window and max-connection-receive-window set the upload windows (6 MiB by default with the governor); max-connection-send-window bounds what one connection's client holds of the server's data (4 MiB, -1 for no limit); queue-cuts (on) lets a download hold its rate beside other traffic (the fork's MetaCubeX#64). The governor sits above TLS and REALITY and shows the HTTP server a metacubex/tls connection as TLS, so ALPN and plaintext probes are answered as before. - h2-params: the server's HTTP/2 settings (max-concurrent-streams, frame size, windows, header tables, ping and write timeouts). A receive window in h2-flow overrides it; with the governor max-concurrent-streams is at most 4096, the streams it tracks. Both blocks are checked before any listener binds. - mux-keep-alive-secs and mux-keep-alive-bytes: a Mux.Cool server pokes a packet-up or stream-up downlink that has carried nothing for that long with a padded KeepAlive frame, which every client discards, so CDNs and reverse proxies do not cut it as idle. Off by default; stream-one is never poked. The poke loop ends with the carrier and its close does not wait for it.
|
In For example, this happens with I suggest adding |
|
#6268 和 #7099 的数据来自手机客户端。这里是另一种场景:节点之间的隧道。一台节点作为 XHTTP 客户端( 修改前: 约 27 小时内 xray 被 OOM killer 杀死 4 次(anon-rss 6.4–7.2 GiB)。heap profile 中 99.6% 的采样内存来自 修改: 只在服务端 inbound 设置 两次从零启动,运行时间和负载相近(约 57700 个 goroutine):
进程运行 12 分 26 秒时,RSS 为 4445 和 2188 MiB。修改后目前只运行了约 12 分钟,尚未发生 OOM;修改前最长一次运行了 24 小时 36 分钟,所以现在还不能确认 OOM 已经解决。 回环测试(同一二进制,无 RTT 和丢包,1000 条 stream,5 轮交替,修改前 / 修改后):上传 1 条 stream 1747 / 1756 Mbit/s,8 条 3439 / 3816 Mbit/s,下载 1426 / 1433 Mbit/s,未见速度下降。反复打开和关闭 stream 8 轮后,RSS 为 311–336 / 139–146 MiB。 #7099 中关于特征的顾虑在逻辑上成立,但我们没有测量,也无法判断其影响有多大,所以这里不是要求修改默认值。对节点间隧道这种场景,可选的 Measurements of The data in #6268 and #7099 comes from phone clients. This is a different case: tunnels between nodes. One node dials two others as an XHTTP client ( Before: xray was OOM-killed 4 times in about 27 hours (anon-rss 6.4–7.2 GiB). 99.6% of sampled heap came from Change: only Two runs from a cold start, similar uptime and load (about 57700 goroutines):
At 12 min 26 s of process uptime, RSS was 4445 and 2188 MiB. The changed setup has only run for about 12 minutes so far, with no OOM yet; the longest run before the change lasted 24 h 36 min, so it is too early to say the OOM kills are gone. Loopback test (same binary, no RTT or loss, 1000 streams, 5 interleaved rounds, before / after): upload on 1 stream 1747 / 1756 Mbit/s, on 8 streams 3439 / 3816 Mbit/s, download 1426 / 1433 Mbit/s; no slowdown seen. After 8 rounds of opening and closing streams, RSS was 311–336 / 139–146 MiB. The fingerprint concern in #7099 is logical, but we did not measure it and cannot say how much it matters, so this is not a request to change the default. For node-to-node tunnels like this one, the opt-in 🤖 Generated with Claude Code |
#7282 (comment)
允许按自身需求调整 HTTP2 config 直接按json解析过去 core 基本不需要代码还自带自动更新
#6268 的受害者也可以自行调整参数 反正一切风险自负就行了