Skip to content

Commit 95bb0b8

Browse files
amcaseyvseanreesermsft
authored andcommitted
Increase the min max queue size to match 7 and 8
1 parent 7d6aec8 commit 95bb0b8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,11 @@ public Http2Connection(HttpConnectionContext context)
189189
? 4 * http2Limits.MaxStreamsPerConnection // 4 is a magic number to give us some padding above the expected maximum size
190190
: (int)ConfiguredMaximumFlowControlQueueSize;
191191

192-
if (IsMaximumFlowControlQueueSizeEnabled && _maximumFlowControlQueueSize < http2Limits.MaxStreamsPerConnection)
192+
var minimumMaximumFlowControlQueueSize = 2 * http2Limits.MaxStreamsPerConnection; // Double to match 7.0 and 8.0
193+
if (IsMaximumFlowControlQueueSizeEnabled && _maximumFlowControlQueueSize < minimumMaximumFlowControlQueueSize)
193194
{
194-
Log.Http2FlowControlQueueMaximumTooLow(context.ConnectionId, http2Limits.MaxStreamsPerConnection, _maximumFlowControlQueueSize);
195-
_maximumFlowControlQueueSize = http2Limits.MaxStreamsPerConnection;
195+
Log.Http2FlowControlQueueMaximumTooLow(context.ConnectionId, minimumMaximumFlowControlQueueSize, _maximumFlowControlQueueSize);
196+
_maximumFlowControlQueueSize = minimumMaximumFlowControlQueueSize;
196197
}
197198

198199
// Start pool off at a smaller size if the max number of streams is less than the InitialStreamPoolSize

src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ public void Http2FlowControlQueueOperationsExceeded(string connectionId, int cou
411411
Http2FlowControlQueueOperationsExceeded(_http3Logger, connectionId, count);
412412
}
413413

414-
[LoggerMessage(56, LogLevel.Debug, @"Connection id ""{ConnectionId}"" configured maximum flow control queue size {Actual} is less than the maximum streams per connection {Expected}. Increasing configured value to {Expected}.", EventName = "Http2FlowControlQueueMaximumTooLow")]
414+
[LoggerMessage(56, LogLevel.Debug, @"Connection id ""{ConnectionId}"" configured maximum flow control queue size {Actual} is less than double the maximum streams per connection {Expected}. Increasing configured value to {Expected}.", EventName = "Http2FlowControlQueueMaximumTooLow")]
415415
private static partial void Http2FlowControlQueueMaximumTooLow(ILogger logger, string connectionId, int expected, int actual);
416416

417417
public void Http2FlowControlQueueMaximumTooLow(string connectionId, int expected, int actual)

0 commit comments

Comments
 (0)