-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/net/http2: add support for SETTINGS_HEADER_TABLE_SIZE #56054
Comments
The specific API is in https://go.dev/cl/435899:
This seems fine to me. |
This proposal has been added to the active column of the proposals project |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
Change https://go.dev/cl/435899 mentions this issue: |
Add support for handling of SETTINGS_HEADER_TABLESIZE in SETTINGS frames. Add http2.Transport.MaxDecoderHeaderTableSize to set the advertised table size for new client connections. Add http2.Transport.MaxEncoderHeaderTableSize to cap the accepted size for new client connections. Add http2.Server.MaxDecoderHeaderTableSize and MaxEncoderHeaderTableSize to do the same on the server. Fixes golang/go#29356 Fixes golang/go#56054 Change-Id: I16ae0f84b8527dc1e09dfce081e9f408fd514513 Reviewed-on: https://go-review.googlesource.com/c/net/+/435899 Reviewed-by: Damien Neil <[email protected]> Reviewed-by: Joedian Reid <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Damien Neil <[email protected]>
Proposal
Support HPACK dynamic table sizes other than the default, specifically:
Context
HTTP/2 uses HPACK for header compression. HPACK is a stateful compression algorithm where both the encoder and decoder reference a static table (defined in the RFC) and maintain a dynamic table. This dynamic table defaults to 4096 bytes and has header fields added/removed in FIFO order over the course of the connection lifetime.
SETTINGS_HEADER_TABLE_SIZE is an h2 setting used to adjust the size of the HPACK dynamic table. The decoder communicates the largest dynamic table size it's willing to support via SETTINGS_HEADER_TABLE_SIZE, then the encoder on the other end of the connection chooses what size it wants to use (up to the decoder's max) and communicates that back to the decoder via a dynamic header table size update instruction. Thus, there are two relevant client settings: the allowable size we want to advertise for our decoder, and the max size we want to use for our encoder.
Use Case
The main motivation is to allow increasing the dynamic table size for http2 connections that multiplex disparate requests, specifically in proxies and load balancers. The default size of 4096 works well for connections servicing a single client, but when multiple clients are bundled together on a reverse proxy's shared upstream connection and sharing the same decoder/encoder, the small table size and churning hurts the HPACK compression ratio, increases bytes on the wire and increases latency.
References
The text was updated successfully, but these errors were encountered: