http2: increase default window sizes#64623
Conversation
|
Review requested:
|
| // to window_size / RTT. With a 32MB connection window, throughput is | ||
| // significantly improved. See https://github.com/nodejs/node/issues/38426 | ||
| CHECK_EQ(nghttp2_session_set_local_window_size( | ||
| session, NGHTTP2_FLAG_NONE, 0, 33554432), 0); |
There was a problem hiding this comment.
There's a pre-existing issue that this exposes: you can't configure this in advance. You can only control the connection window with session.setLocalWindowSize once you have a session, but at that point this initial WINDOW_UPDATE has already been sent, and shrinking the window isn't effective as shown in the tests here (it just blocks further updates, it can't reduce what's already been sent). The stream window is configurable in advance (it's a SETTINGS parameter) but this connection window isn't.
That already existed implicitly but it was kind of OK when the initial window was small, but it's a real problem with a very large initial window I think, since there's basically no way to override this to make it any smaller again if you need to.
Can we add client & server options for this, so it can be configured before the first WINDOW_UPDATE is sent somehow?
| // to window_size / RTT. With a 32MB connection window, throughput is | ||
| // significantly improved. See https://github.com/nodejs/node/issues/38426 | ||
| CHECK_EQ(nghttp2_session_set_local_window_size( | ||
| session, NGHTTP2_FLAG_NONE, 0, 33554432), 0); |
There was a problem hiding this comment.
Nit: would be nicer to extract this as a constant
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64623 +/- ##
==========================================
- Coverage 90.23% 90.14% -0.09%
==========================================
Files 741 741
Lines 241681 242143 +462
Branches 45547 45560 +13
==========================================
+ Hits 218075 218279 +204
- Misses 15141 15373 +232
- Partials 8465 8491 +26
🚀 New features to boost your workflow:
|
5c9bc03 to
4351b51
Compare
|
Both addressed:
|
4351b51 to
31761a0
Compare
RafaelGSS
left a comment
There was a problem hiding this comment.
Wouldn't it be
semver-major
|
yes |
3825c24 to
70882db
Compare
Increase the default HTTP/2 stream window from 64KB (65535) to 4MB (4194304) and the default local connection window to 32MB (33554432). The default 64KB window limits throughput on high-latency connections to window_size / RTT. With a 250ms RTT, throughput is limited to 256KB/s. The new defaults improve throughput to 16MB/s (128Mbps) for the stream window and 128MB/s (1Gbps) for the connection window. Fixes: nodejs#38426 Signed-off-by: Matteo Collina <hello@matteocollina.com>
70882db to
bd4cbd3
Compare
Increase the default HTTP/2 stream window from 64KB (65535) to 4MB
(4194304) and the default local connection window to 32MB (33554432).
The default 64KB window limits throughput on high-latency connections
to
window_size / RTT. With a 250ms RTT, throughput is limited to256KB/s. The new defaults improve throughput to 16MB/s (128Mbps)
for the stream window and 128MB/s (1Gbps) for the connection window.
Fixes #38426