Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1d41853
Implement dynamic HTTP2 window scaling
antonfirsov Jun 25, 2021
4067443
Merge branch 'main' into http/dynamic-window-02
antonfirsov Jun 25, 2021
a3800d3
actually fix the conflict with #54437
antonfirsov Jun 25, 2021
9f50764
add comment on PING payloads
antonfirsov Jun 25, 2021
3c7c474
delete StringBuilderOutput
antonfirsov Jun 25, 2021
6eb66e9
DisableDynamicWindowSizing: fix name
antonfirsov Jun 25, 2021
4c7f3ac
make RttEstimator.MinRtt thread-safe
antonfirsov Jun 26, 2021
473139d
simplify RuntimeSettingParserTest code
antonfirsov Jun 28, 2021
f2ff4ee
respond to PING while reading CONTINUATION frames in ProcessHeadersFrame
antonfirsov Jun 28, 2021
2bf13e0
fix test
antonfirsov Jun 28, 2021
526d723
add PingBeforeContinuationFrame_Success
antonfirsov Jun 28, 2021
7362e87
WIP: SetupAutomaticPingResponse by default
antonfirsov Jun 30, 2021
4dfcfeb
WIP: SetupAutomaticPingResponse by default
antonfirsov Jun 30, 2021
6e9142b
fix Http2_PingKeepAlive formatting
antonfirsov Jun 30, 2021
e30ab75
delete manual ping response setup code
antonfirsov Jun 30, 2021
20416ac
disallow PING frames before CONTINUATION again
antonfirsov Jun 30, 2021
9f53e0a
move process-wide settings to GlobalHttpSettings & remove MaximumWind…
antonfirsov Jun 30, 2021
13d2066
cleanup defaults
antonfirsov Jun 30, 2021
e6cc7c3
nits
antonfirsov Jun 30, 2021
b89e4bc
reduce footprint of Http2StreamWindowManager & RttEstimator
antonfirsov Jun 30, 2021
1df65a2
comments
antonfirsov Jun 30, 2021
3e18b0b
allow receiving PING ACK after GOAWAY
antonfirsov Jun 30, 2021
fb3b90e
Merge branch 'main' into http/dynamic-window-02
antonfirsov Jun 30, 2021
a54dfdc
nit
antonfirsov Jun 30, 2021
dd8d2cc
defer _lastWindowUpdate = Stopwatch.GetTimestamp()
antonfirsov Jun 30, 2021
4f302c7
delete extra newlines
antonfirsov Jun 30, 2021
e4d8639
remove _respondToPing
antonfirsov Jun 30, 2021
c7761e2
Http2LoopbackConnection: allow PING ACK after GOAWAY
antonfirsov Jun 30, 2021
e23cac8
EnableTransparentPingResponse = false in Http2_PingKeepAlive
antonfirsov Jun 30, 2021
70a04c3
commit suggestion
antonfirsov Jun 30, 2021
ddd6ea1
Merge branch 'main' into http/dynamic-window-02
antonfirsov Jul 1, 2021
7b006a5
sync DiagnosticsHandler with #54437
antonfirsov Jul 1, 2021
bc2b9b5
fix build
antonfirsov Jul 1, 2021
95f9e0d
Apply suggestions
antonfirsov Jul 2, 2021
aba1735
separate _expectPingFrame and _transparentPingResponse functionality
antonfirsov Jul 2, 2021
5cbf0e1
check for _streamWindowSize < MaxStreamWindowSize before trying to ex…
antonfirsov Jul 2, 2021
cd94dcf
nit
antonfirsov Jul 5, 2021
6954f61
move DefaultInitialHttp2StreamWindowSize
antonfirsov Jul 5, 2021
6dbfa47
harden LowBandwidthDelayProduct_ClientStreamReceiveWindowStopsScaling
antonfirsov Jul 5, 2021
3009773
delete unreliable LowBandwidthDelayProduct_ClientStreamReceiveWindowS…
antonfirsov Jul 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions
Co-authored-by: Geoff Kizer <[email protected]>
  • Loading branch information
antonfirsov and geoffkizer authored Jul 2, 2021
commit 95f9e0dd8ece53d2f628cadf9bc97b0a274467b3
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public async ValueTask SetupAsync()
_outgoingBuffer.Commit(s_http2ConnectionPreface.Length);

// Send SETTINGS frame. Disable push promise & set initial window size.
FrameHeader.WriteTo(_outgoingBuffer.AvailableSpan, 2*FrameHeader.SettingLength, FrameType.Settings, FrameFlags.None, streamId: 0);
FrameHeader.WriteTo(_outgoingBuffer.AvailableSpan, 2 * FrameHeader.SettingLength, FrameType.Settings, FrameFlags.None, streamId: 0);
_outgoingBuffer.Commit(FrameHeader.Size);
BinaryPrimitives.WriteUInt16BigEndian(_outgoingBuffer.AvailableSpan, (ushort)SettingId.EnablePush);
_outgoingBuffer.Commit(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ private static TimeSpan StopwatchTicksToTimeSpan(long stopwatchTicks)
}

// Estimates Round Trip Time between the client and the server by sending PING frames, and measuring the time interval until a PING ACK is received.
// Assuming that the network characteristics of the connection wouldn't change much within it's lifetime, we are maintaining a running minimum value.
// Assuming that the network characteristics of the connection wouldn't change much within its lifetime, we are maintaining a running minimum value.
// The more PINGs we send, the more accurate is the estimation of MinRtt, however we should be careful not to send too many of them,
// to avoid triggering the server's PING flood protection which may result in an unexpected GOAWAY.
// With most servers wee are fine to send PINGs, as long as we are reading their data, this is rule is well formalized for gRPC:
// With most servers we are fine to send PINGs, as long as we are reading their data, this rule is well formalized for gRPC:
// https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md
// As a rule of thumb, we can send send a PING whenever we receive DATA or HEADERS, however, there are some servers which allow receiving only
// a limited amount of PINGs within a given timeframe.
Expand All @@ -156,7 +156,7 @@ private static TimeSpan StopwatchTicksToTimeSpan(long stopwatchTicks)
// Threading:
// OnInitialSettingsSent() is called during initialization, all other methods are triggered by HttpConnection.ProcessIncomingFramesAsync(),
// therefore the assumption is that the invocation of RttEstimator's methods is sequential, and there is no race beetween them.
// Http2StreamWindowManager is reading MinRtt from another concurrent thread, therefore it's value has to be changed atomically.
// Http2StreamWindowManager is reading MinRtt from another concurrent thread, therefore its value has to be changed atomically.
private struct RttEstimator
{
private enum State
Expand All @@ -170,7 +170,7 @@ private enum State

private const double PingIntervalInSeconds = 2;
private const int InitialBurstCount = 4;
private static readonly long PingIntervalInTicks =(long)(PingIntervalInSeconds * Stopwatch.Frequency);
private static readonly long PingIntervalInTicks = (long)(PingIntervalInSeconds * Stopwatch.Frequency);

private State _state;
private long _pingSentTimestamp;
Expand Down Expand Up @@ -232,7 +232,7 @@ internal void OnPingAckReceived(long payload, Http2Connection connection)
return;
}

//RTT PINGs always carry negavie payload, positive values indicate a response to KeepAlive PING.
// RTT PINGs always carry negative payload, positive values indicate a response to KeepAlive PING.
Debug.Assert(payload < 0);

if (_pingCounter != payload)
Expand Down