Skip to content
代码片段 群组 项目
提交 90be960f 编辑于 作者: Andrew Casey's avatar Andrew Casey 提交者: Sean Reeser
浏览文件

Clarify some log messages and comments

上级 c1d9659b
No related branches found
No related tags found
无相关合并请求
......@@ -46,13 +46,13 @@ internal sealed partial class Http2Connection : IHttp2StreamLifetimeHandler, IHt
private const int MaxStreamPoolSize = 100;
private const long StreamPoolExpiryTicks = TimeSpan.TicksPerSecond * 5;
private const string EnhanceYourCalmMaximumCountProperty = "Microsoft.AspNetCore.Server.Kestrel.Http2.EnhanceYourCalmCount";
private const string MaximumEnhanceYourCalmCountProperty = "Microsoft.AspNetCore.Server.Kestrel.Http2.MaxEnhanceYourCalmCount";
private static readonly int _enhanceYourCalmMaximumCount = GetEnhanceYourCalmMaximumCount();
private static readonly int _enhanceYourCalmMaximumCount = GetMaximumEnhanceYourCalmCount();
private static int GetEnhanceYourCalmMaximumCount()
private static int GetMaximumEnhanceYourCalmCount()
{
var data = AppContext.GetData(EnhanceYourCalmMaximumCountProperty);
var data = AppContext.GetData(MaximumEnhanceYourCalmCountProperty);
if (data is int count)
{
return count;
......@@ -1290,6 +1290,8 @@ internal sealed partial class Http2Connection : IHttp2StreamLifetimeHandler, IHt
void IRequestProcessor.Tick(DateTimeOffset now)
{
Input.CancelPendingRead();
// We count EYCs over a window of a given length to avoid flagging short-lived bursts.
// At the end of each window, reset the count.
if (IsEnhanceYourCalmEnabled && ++_tickCount % EnhanceYourCalmTickWindowCount == 0)
{
Interlocked.Exchange(ref _enhanceYourCalmCount, 0);
......
......@@ -105,7 +105,7 @@ internal sealed class Http2FrameWriter
_hpackEncoder = new DynamicHPackEncoder(serviceContext.ServerOptions.AllowResponseHeaderCompression);
_maximumFlowControlQueueSize = ConfiguredMaximumFlowControlQueueSize is null
? 4 * maxStreamsPerConnection
? 4 * maxStreamsPerConnection // 4 is a magic number to give us some padding above the expected maximum size
: (int)ConfiguredMaximumFlowControlQueueSize;
if (IsMaximumFlowControlQueueSizeEnabled && _maximumFlowControlQueueSize < maxStreamsPerConnection)
......
......@@ -146,13 +146,13 @@ internal sealed partial class KestrelTrace : ILogger
// Highest shared ID is 63. New consecutive IDs start at 64
[LoggerMessage(64, LogLevel.Debug, @"Connection id ""{ConnectionId}"" aborted since at least ""{Count}"" ENHANCE_YOUR_CALM responses were required per second.", EventName = "Http2TooManyEnhanceYourCalms")]
[LoggerMessage(64, LogLevel.Debug, @"Connection id ""{ConnectionId}"" aborted since at least {Count} ENHANCE_YOUR_CALM responses were recorded per second.", EventName = "Http2TooManyEnhanceYourCalms")]
public static partial void Http2TooManyEnhanceYourCalms(ILogger logger, string connectionId, int count);
[LoggerMessage(65, LogLevel.Debug, @"Connection id ""{ConnectionId}"" exceeded the output flow control maximum queue size of ""{Count}"".", EventName = "Http2FlowControlQueueOperationsExceeded")]
[LoggerMessage(65, LogLevel.Debug, @"Connection id ""{ConnectionId}"" exceeded the output flow control maximum queue size of {Count}.", EventName = "Http2FlowControlQueueOperationsExceeded")]
public static partial void Http2FlowControlQueueOperationsExceeded(ILogger logger, string connectionId, int count);
[LoggerMessage(66, LogLevel.Debug, @"Connection id ""{ConnectionId}"" configured maximum flow control queue size ""{Actual}"" is less than the maximum streams per connection ""{Expected}"" - increasing to match.", EventName = "Http2FlowControlQueueMaximumTooLow")]
[LoggerMessage(66, 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")]
public static partial void Http2FlowControlQueueMaximumTooLow(ILogger logger, string connectionId, int expected, int actual);
}
}
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册