Skip to content

fix: increase HTTP/2 connection window default from 64KB to 1MB (#6238) - #6273

Open
waterWang wants to merge 2 commits into
eclipse-vertx:masterfrom
waterWang:fix/http2-connection-window-size
Open

fix: increase HTTP/2 connection window default from 64KB to 1MB (#6238)#6273
waterWang wants to merge 2 commits into
eclipse-vertx:masterfrom
waterWang:fix/http2-connection-window-size

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Fixes #6238

Description

The default HTTP/2 connection window size is -1, which means Netty's default stream initial window size (64KB) is used for the connection window. For large payloads (e.g., 10MB+ gRPC messages), this requires hundreds of WINDOW_UPDATE round-trips before the application receives the full body, causing 25s+ latency vs ~1s with a properly sized window.

Changes

  • HttpServerOptions.java: Changed DEFAULT_HTTP2_CONNECTION_WINDOW_SIZE from -1 to 1024 * 1024 (1MB)
  • HttpClientOptions.java: Same change for consistency

Why 1MB?

  • Matches Netty's default HTTP/2 connection window size used by the legacy gRPC-Java/Netty stack
  • Large enough to avoid excessive WINDOW_UPDATE round-trips for typical large messages (10MB+)
  • Small enough to not significantly increase memory pressure (the window is a budget, not an allocation)
  • Users who need a different value can still configure it via setConnectionWindowSize()

Verification

  • The condition connectionWindowSize > 0 in HttpServerConnectionHandler.java already handles positive values correctly
  • With the new default of 1MB, setWindowSize() will be called with a reasonable value
  • No behavioral change for users who explicitly configure setConnectionWindowSize()

@vietj vietj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the javadoc should be updated accordingly

@vietj vietj added this to the 5.2.0 milestone Aug 13, 2026
@vietj vietj self-assigned this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Large HTTP/2 request bodies (gRPC 10MB+) are extremely slow

2 participants