QGrpcHttp2Channel: raise the default HTTP/2 receive window
A bare QHttp2Configuration advertises only a 64 KiB receive window for
both the stream and the connection. HTTP/2 flow control bounds the
unacknowledged data the peer may send, so download throughput is capped
at window/RTT: on a fast link the sender stalls waiting for
WINDOW_UPDATE frames and the pipe sits idle.
Default to a 4 MiB per-stream and 16 MiB per-connection receive window.
The connection window is kept the larger of the two so it never
bottlenecks multiplexed streams; both match the windows used by the C++
gRPC reference and Go's net/http2.
Measured with tests/manual/grpc/benchmarks (asyncbenchserver, 1000
calls, http loopback, arm64 macOS), stock vs. patched:
payload RPC before after delta
16 KiB ServerStreaming 428 MB/s 1.10 GB/s +157%
256 KiB ServerStreaming 470 MB/s 2.68 GB/s +471%
1 MiB ServerStreaming 471 MB/s 2.98 GB/s +533% (2.23 s → 353 ms)
1 MiB BidiStreaming 743 MB/s 2.31 GB/s +211% (2.82 s → 910 ms)
1 MiB UnaryCall 747 MB/s 1.89 GB/s +153% (2.81 s → 1.11 s)
UnaryCall server→client response latency at 1 MiB drops from 2.19 ms to
454 µs (−79%). Small messages stay within run-to-run noise, and
upload-only ClientStreaming is unchanged because the client receive
window does not govern outbound data.
[ChangeLog][QtGrpc][QGrpcHttp2Channel] The default HTTP/2 receive window
was raised from 64 KiB to 4 MiB per stream and 16 MiB per connection.
The per-stream window can be tuned via the
QT_GRPC_HTTP2_STREAM_RECEIVE_WINDOW_SIZE environment variable and the
connection window via QT_GRPC_HTTP2_CONNECTION_RECEIVE_WINDOW_SIZE
Pick-to: 6.12 6.11 6.8
Fixes: QTBUG-136766
Change-Id: Ide6ae9dd941283519052632db7165583d1002a00
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>