Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

KestrelServerLimits Class

Definition

Namespace:
Microsoft.AspNetCore.Server.Kestrel.Core
Assembly:
Microsoft.AspNetCore.Server.Kestrel.Core.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Server.Kestrel.Core v2.0.0
Package:
Microsoft.AspNetCore.Server.Kestrel.Core v2.1.0
Package:
Microsoft.AspNetCore.Server.Kestrel.Core v2.2.0
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
KestrelServerLimits.cs
Source:
KestrelServerLimits.cs
Source:
KestrelServerLimits.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Limits for KestrelServer.

public ref class KestrelServerLimits
public class KestrelServerLimits
type KestrelServerLimits = class
Public Class KestrelServerLimits
Inheritance
KestrelServerLimits

Constructors

Name Description
KestrelServerLimits()

Properties

Name Description
Http2

Limits only applicable to HTTP/2 connections.

Http3

Limits only applicable to HTTP/3 connections.

KeepAliveTimeout

Gets or sets the keep-alive timeout. Defaults to 130 seconds.

MaxConcurrentConnections

Gets or sets the maximum number of open connections. When set to null, the number of connections is unlimited.

Defaults to null.

MaxConcurrentUpgradedConnections

Gets or sets the maximum number of open, upgraded connections. When set to null, the number of upgraded connections is unlimited. An upgraded connection is one that has been switched from HTTP to another protocol, such as WebSockets.

Defaults to null.

MaxRequestBodySize

Gets or sets the maximum allowed size of any request body in bytes. When set to null, the maximum request body size is unlimited. This limit has no effect on upgraded connections which are always unlimited. This can be overridden per-request via IHttpMaxRequestBodySizeFeature. Defaults to 30,000,000 bytes, which is approximately 28.6MB.

MaxRequestBufferSize

Gets or sets the maximum size of the request buffer. Defaults to 1,048,576 bytes (1 MB).

MaxRequestHeaderCount

Gets or sets the maximum allowed number of headers per HTTP request. Defaults to 100.

MaxRequestHeadersTotalSize

Gets or sets the maximum allowed size for the HTTP request headers. Defaults to 32,768 bytes (32 KB).

MaxRequestLineSize

Gets or sets the maximum allowed size for the HTTP request line. Defaults to 8,192 bytes (8 KB).

MaxResponseBufferSize

Gets or sets the maximum size of the response buffer before write calls begin to block or return tasks that don't complete until the buffer size drops below the configured limit. Defaults to 65,536 bytes (64 KB).

MinRequestBodyDataRate

Gets or sets the request body minimum data rate in bytes/second. Setting this property to null indicates no minimum data rate should be enforced. This limit has no effect on upgraded connections which are always unlimited. This can be overridden per-request via IHttpMinRequestBodyDataRateFeature. Defaults to 240 bytes/second with a 5 second grace period.

MinResponseDataRate

Gets or sets the response minimum data rate in bytes/second. Setting this property to null indicates no minimum data rate should be enforced. This limit has no effect on upgraded connections which are always unlimited. This can be overridden per-request via IHttpMinResponseDataRateFeature.

Defaults to 240 bytes/second with a 5 second grace period.

RequestHeadersTimeout

Gets or sets the maximum amount of time the server will spend receiving request headers. Defaults to 30 seconds.

Applies to


Feedback

Was this page helpful?