http2: honor H2WindowSize as stream window floor - #710
Open
Witaminer wants to merge 1 commit into
Open
Conversation
Use the configured H2WindowSize as the lower bound for adaptive receive window sizing, preventing the tuner from getting stuck at a much smaller value.
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.
This changes the adaptive HTTP/2 receive window logic so that the configured H2WindowSize is used as the lower bound for stream window sizing.
Without this, the adaptive tuner can start from a much smaller
stream->in_window_sizereturned by nghttp2 and get stuck there. The growth condition depends onamount > thigh, while in practice the reported consumption chunks are often much smaller thanthigh, so the window may never grow again.The issue was reproduced with current httpd trunk, as well as with the older mod_http2 2.0.42, using repeated 4 GiB HTTP/2 request-body uploads over a non-zero RTT connection.
Before this change, the issue was repeatedly reproduced across many 4 GiB HTTP/2 request-body uploads, with RTTs ranging from approximately 1 ms to 150 ms. On current trunk, repeated consecutive test runs showed the characteristic collapse from full speed to about 4.7 MB/s, with occasional runs completing normally.
With this change applied to the same source tree and configuration, five consecutive 4 GiB uploads completed without a collapse, at approximately 328-341 MB/s on a sender limited to 3 Gbps.
The change also calculates the 80%/20% thresholds using
apr_int64_tto avoid overflow when larger configured window sizes are used.