Repository navigation
Raise HTTP/2 receive windows and close TLS conns without waiting - #976
Merged
Merged
Conversation
hackney ran HTTP/2 with the default 64 KB stream and connection windows,
so a large download moved one window per round trip. Over a slow link a
40 MB body outlasted the server's stream timeout and failed with
{stream_error, internal_error}. Use 8 MB per stream and 32 MB for the
connection (h2 0.12.5 connection_window_size).
ssl:close/1 waits for the server to close its side, at least one round
trip, so the pool's 100 ms stop budget killed pooled TLS conns and logged
a supervisor report. Shut the socket down before closing it so the conn
stops at once.
Merged
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.
Large HTTP/2 downloads failed with
{stream_error, internal_error}over slow links (for example 41 MB from PeeringDB, fine over HTTP/1.1 and curl). hackney kept the default 64 KB stream and connection windows, so only one window moved per round trip and the server reset the stream at its timeout. hackney now asks for 8 MB per stream and 32 MB for the connection, using the newconnection_window_sizeoption in h2 0.12.5. At 250 ms RTT this matches HTTP/1.1.Pooled TLS connections were also logged as killed by
hackney_conn_sup.ssl:close/1waits for the server to close its side, which takes longer than the pool's 100 ms stop budget. The conn now shuts the socket down before closing it, so it exits normally.Note: with
async once, a single stream can now have up to 8 MB in flight instead of 64 KB.