Repository navigation
Conversation
net/http's server defaults are 1 MiB per connection and per stream, capping uplink at ~1 MiB per RTT (~160 Mbit/s at 52 ms). Raise to 64 MiB / 16 MiB, in line with the x/net/http2 client defaults.
00c5828 to
11793c6
Compare
|
另外你看看其它传输层/入站的情况 |
|
Checked the other transports/inbounds; the XHTTP h1/h2 server is the only place left on the 1 MiB
On memory: these are upper bounds, not allocations. The server buffers only data that the client has sent and the handler hasn't read yet. In normal relaying the handler drains it right away. The bound only matters when the outbound is slower than the client. |
|
64MB 太大了,per connection and per stream 都改成 10MB 比较合适, |
|
Done: both are 10 MiB now (abd3628). |
|
但是对于直接监听的服务端这个属于可观测的特征 前置nginx的情况下这个归ngx管 而且这个只是 uplink 而已 一般 uplink 不会很大 |
|
仍需讨论 |
|
Thanks for reopening. On Fangliding's point about observability: the current 1 MiB window is itself a fingerprint (it's the Go net/http default, so it identifies a Go h2 server just as well), and it is only visible after the TLS/REALITY handshake, so a passive or active prober doesn't see it before authenticating. Behind nginx nothing changes, as noted. If changing the default is still a concern, I can make it opt-in instead: |
|
确实有人需要调整数个HTTP2字段 按照自由主义理念干脆透明传出允许随便填好了 我稍微弄一下 |
#7282 (comment) #7295 (comment) Closes #6268 --------- Co-authored-by: pqhaz3925 <[email protected]>
Summary
The XHTTP h1/h2 server uses
net/http's HTTP/2 defaults: 1 MiB receive window per connection and per stream. All uplink traffic on one h2 connection (stream-up, stream-one, and packet-up over XMUX) shares that window, so uplink is capped at ~1 MiB per RTT, about 160 Mbit/s at 50 ms RTT and lower on longer paths.This sets
http.Server.HTTP2to 10 MiB per connection and per stream (about 1.6 Gbit/s per connection at 52 ms RTT). Buffers are only allocated as data arrives. It's server-only, so existing clients benefit without changes. XHTTP/3 (QUIC windows) is not affected.Test
VLESS + XHTTP + REALITY, stock 26.10.21 client (macOS) → Linux server, 52 ms RTT, iperf3 12 s through the tunnel (Mbit/s):
Download differences are within run-to-run noise; uplink improves 1.3–3.6×. (Measured with 64/16 MiB windows; the test link tops out around 500 Mbit/s, below what 10 MiB allows.)
go test ./transport/internet/splithttppasses