Skip to content

transport: add max_frame_size to client Endpoint#2592

Open
timlee0119 wants to merge 1 commit intohyperium:masterfrom
timlee0119:client-max-frame-size
Open

transport: add max_frame_size to client Endpoint#2592
timlee0119 wants to merge 1 commit intohyperium:masterfrom
timlee0119:client-max-frame-size

Conversation

@timlee0119
Copy link
Copy Markdown

@timlee0119 timlee0119 commented Apr 14, 2026

Motivation

tonic already exposes Server::max_frame_size() to let servers configure this parameter, but the
client-side Endpoint struct has no equivalent API. The underlying hyper HTTP/2 Builder already
supports .max_frame_size(), so this change simply wires it through from the client-side endpoint
configuration.

I've seen production speedup in our gRPC service by increasing this client-side max_frame_size to allow the server to send a large response (multi-MB) without excessive framing overheads caused by the default 16 KiB setting.

Solution

Add a new max_frame_size field to the Endpoint struct and expose it via a public builder method,
mirroring the server-side pattern:

  • Add max_frame_size: Option<u32> field to Endpoint
  • Add public pub fn max_frame_size(self, frame_size: impl Into<Option<u32>>) -> Self builder method
  • Wire the field through to hyper's Builder::max_frame_size() in connection.rs
  • Include integration test verifying the feature works end-to-end

Refs: #264

Mirrors the existing server-side `Server::max_frame_size` API. The
underlying hyper `Builder` already supports this; this change simply
wires the option through from `Endpoint` configuration.

This enables clients to configure the maximum HTTP/2 frame size,
which is useful for supporting large payloads without excessive
frame fragmentation.

Includes integration test verifying the new API works with the server.

Refs: hyperium#264
@timlee0119 timlee0119 marked this pull request as ready for review April 14, 2026 22:47
@timlee0119
Copy link
Copy Markdown
Author

@dfawley gentle ping on this tiny PR. Thanks!

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.

1 participant