Skip to content

http2: honor H2WindowSize as stream window floor - #710

Open
Witaminer wants to merge 1 commit into
apache:trunkfrom
Witaminer:patch-1
Open

http2: honor H2WindowSize as stream window floor#710
Witaminer wants to merge 1 commit into
apache:trunkfrom
Witaminer:patch-1

Conversation

@Witaminer

Copy link
Copy Markdown

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_size returned by nghttp2 and get stuck there. The growth condition depends on amount > thigh, while in practice the reported consumption chunks are often much smaller than thigh, 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_t to avoid overflow when larger configured window sizes are used.

Use the configured H2WindowSize as the lower bound for adaptive receive window sizing, preventing the tuner from getting stuck at a much smaller value.
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