http2: add new connectionWindowSize option - #65619
Merged
nodejs-github-bot merged 1 commit intoSep 9, 2026
Merged
Conversation
Collaborator
|
Review requested:
|
Signed-off-by: Tim Perry <pimterry@gmail.com>
pimterry
force-pushed
the
http2-connection-window-size-option
branch
from
August 28, 2026 15:17
6e6d342 to
137d777
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65619 +/- ##
==========================================
- Coverage 90.07% 90.06% -0.01%
==========================================
Files 751 751
Lines 254881 254932 +51
Branches 48111 48124 +13
==========================================
+ Hits 229582 229603 +21
- Misses 16486 16496 +10
- Partials 8813 8833 +20
🚀 New features to boost your workflow:
|
Collaborator
ZYSzys
approved these changes
Sep 9, 2026
Collaborator
|
Landed in b12688c |
Contributor
|
This does land cleanly on v26.x-staging, can you please open a manual backport PR? |
nodejs-github-bot
added a commit
that referenced
this pull request
Oct 5, 2026
Notable changes: benchmark: * (SEMVER-MINOR) add http header validator benchmark (James M Snell) #66334 buffer: * (SEMVER-MINOR) add isLatin1 (James M Snell) #66298 * (SEMVER-MINOR) add isLatin1 (James M Snell) #66298 * (SEMVER-MINOR) add Buffer.stringLength() (Matteo Collina) #66064 build, doc: * move to redesign (Aviv Keller) #62045 http: * (SEMVER-MINOR) add isValidHeaderName() and isValidHeaderValue() (James M Snell) #66334 http2: * (SEMVER-MINOR) add new connectionWindowSize option (Tim Perry) #65619 lib: * (SEMVER-MINOR) fix stream loading bug in node:bench (James M Snell) #66114 perf_hooks: * (SEMVER-MINOR) fix truncation of monitorEventLoopDelay() resolution (James M Snell) #66115 * (SEMVER-MINOR) allow RecordableHistogram to record 0 (James M Snell) #66114 * (SEMVER-MINOR) add histogram.diff() (James M Snell) #66099 * (SEMVER-MINOR) report histogram memory to V8 (James M Snell) #66099 * (SEMVER-MINOR) add histogram.snapshot() (James M Snell) #66099 * (SEMVER-MINOR) add histogram export format version 2 (James M Snell) #66098 * (SEMVER-MINOR) harden histogram CBOR import validation (James M Snell) #66098 process: * (SEMVER-MINOR) graduate process.ref/unref from experimental (James M Snell) #66213 sqlite: * (SEMVER-MINOR) rename DatabaseSync and StatementSync (Guilherme Araújo) #65988 src: * (SEMVER-MINOR) add --process-timeout=N (James M Snell) #66138 * (SEMVER-MINOR) expose size and count in heap profile output (Ilyas Shabi) #65737 * (SEMVER-MINOR) let embedders exempt linked bindings from the addon permission (Shelley Vohr) #66067 test: * deflake sliding window histogram test (James M Snell) #66132 PR-URL: #66546
Contributor
|
Something I'm noticing while working on the changelog for the new release: we usually prefer |
aduh95
pushed a commit
that referenced
this pull request
Oct 6, 2026
Notable changes: buffer: * (SEMVER-MINOR) add isLatin1 (James M Snell) #66298 * (SEMVER-MINOR) add Buffer.stringLength() (Matteo Collina) #66064 build, doc: * move to redesign (Aviv Keller) #62045 http: * (SEMVER-MINOR) add isValidHeaderName() and isValidHeaderValue() (James M Snell) #66334 http2: * (SEMVER-MINOR) add new connectionWindowSize option (Tim Perry) #65619 perf_hooks: * (SEMVER-MINOR) fix truncation of monitorEventLoopDelay() resolution (James M Snell) #66115 * (SEMVER-MINOR) allow RecordableHistogram to record 0 (James M Snell) #66114 * (SEMVER-MINOR) add histogram.diff() (James M Snell) #66099 * (SEMVER-MINOR) report histogram memory to V8 (James M Snell) #66099 * (SEMVER-MINOR) add histogram.snapshot() (James M Snell) #66099 * (SEMVER-MINOR) add histogram export format version 2 (James M Snell) #66098 * (SEMVER-MINOR) harden histogram CBOR import validation (James M Snell) #66098 process: * (SEMVER-MINOR) graduate process.ref/unref from experimental (James M Snell) #66213 sqlite: * (SEMVER-MINOR) rename DatabaseSync and StatementSync (Guilherme Araújo) #65988 src: * (SEMVER-MINOR) add --process-timeout=N (James M Snell) #66138 * (SEMVER-MINOR) expose size and count in heap profile output (Ilyas Shabi) #65737 * (SEMVER-MINOR) let embedders exempt linked bindings from the addon permission (Shelley Vohr) #66067 PR-URL: #66546
aduh95
pushed a commit
that referenced
this pull request
Oct 6, 2026
Notable changes: buffer: * (SEMVER-MINOR) add isLatin1 (James M Snell) #66298 * (SEMVER-MINOR) add Buffer.stringLength() (Matteo Collina) #66064 build, doc: * move to redesign (Aviv Keller) #62045 doc: * promote Alpine Linux to tier 2 support (Stewart X Addison) #63737 http: * (SEMVER-MINOR) add isValidHeaderName() and isValidHeaderValue() (James M Snell) #66334 http2: * (SEMVER-MINOR) add new connectionWindowSize option (Tim Perry) #65619 perf_hooks: * (SEMVER-MINOR) fix truncation of monitorEventLoopDelay() resolution (James M Snell) #66115 * (SEMVER-MINOR) allow RecordableHistogram to record 0 (James M Snell) #66114 * (SEMVER-MINOR) add histogram.diff() (James M Snell) #66099 * (SEMVER-MINOR) add histogram.snapshot() (James M Snell) #66099 * (SEMVER-MINOR) harden histogram CBOR import validation (James M Snell) #66098 process: * (SEMVER-MINOR) graduate process.ref/unref from experimental (James M Snell) #66213 sqlite: * (SEMVER-MINOR) rename DatabaseSync and StatementSync (Guilherme Araújo) #65988 src: * (SEMVER-MINOR) add --process-timeout=N (James M Snell) #66138 * (SEMVER-MINOR) expose size and count in heap profile output (Ilyas Shabi) #65737 * (SEMVER-MINOR) let embedders exempt linked bindings from the addon permission (Shelley Vohr) #66067 PR-URL: #66546
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#64623 massively increased the default HTTP/2 connection window size from 64KB bytes to 32MB.
This is definitely a good thing for bandwidth in common scenarios, but there's no way for users to opt-out of this change or to shrink the window themselves for other use cases.
That limitation is because the only way to change this today is through
setLocalWindowSize, which is only available for dynamic changes after connection setup. Unfortunately, once an HTTP/2 connection is set up it's impossible to shrink the initial window back below the advertised amount (impossible in the protocol, not just our implementation), so changes only apply once the initial window has been used up. With a default of 32MB per session, that can take a while.Shrinking the window can be useful as a quick workaround to preserve old behaviour, or to optimize for low-latency connections or constrained memory environments, where you want smaller buffers & more responsive backpressure instead of a huge window optimized for throughput over high-latency.
This PR adds a new HTTP/2
connectionWindowSizeoption to let you configure the initial connection window. If set, it overrides the initial window that's configured on nghttp2 before the session connects.En route this also commonizes some option validation into
validateSessionOptions, deduplicating some existing validation and giving a single place to add the validation for this new option.