HTTP/2 Hosting Limits Configuration
Configure the HTTP/2 specific protocol limits for the Kestrel web server.
For detailed information about HTTP/2 settings in .NET 8, see Kestrel HTTP/2 Limits.
Configuration Path
Section titled “Configuration Path”HAKOM:TSM:Http:Hosting:Limits:Http2Configuration Structure
Section titled “Configuration Structure”The following options are available:
Http2├─ MaxStreamsPerConnection├─ HeaderTableSize├─ MaxFrameSize├─ MaxRequestHeaderFieldSize├─ InitialConnectionWindowSize├─ InitialStreamWindowSize├─ KeepAlivePingDelay└─ KeepAlivePingTimeoutConfiguration Elements
Section titled “Configuration Elements”| Element | Type | Default | Required | Description |
|---|---|---|---|---|
MaxStreamsPerConnection |
int |
100 |
The maximum number of concurrent HTTP/2 streams per connection. | |
HeaderTableSize |
int |
4096 |
The maximum size of the header compression table in bytes (4 KB). | |
MaxFrameSize |
int |
16384 |
The maximum size of an HTTP/2 frame in bytes (16 KB). Must be between 16,384 and 16,777,215. | |
MaxRequestHeaderFieldSize |
int |
8192 |
The maximum size of a single request header field in bytes (8 KB). | |
InitialConnectionWindowSize |
int |
128000 |
The initial connection-level flow control window size in bytes. Must be between 65,535 and 2,147,483,647. | |
InitialStreamWindowSize |
int |
96000 |
The initial stream-level flow control window size in bytes. Must be between 65,535 and 2,147,483,647. | |
KeepAlivePingDelay |
TimeSpan |
— | The time interval for sending HTTP/2 keep-alive pings. Specified in the format hh:mm:ss. Infinite by default, which disables keep-alive pings. |
|
KeepAlivePingTimeout |
TimeSpan |
00:00:20 |
The timeout for HTTP/2 keep-alive ping responses. Specified in the format hh:mm:ss. |
Understanding HTTP/2 Settings
Section titled “Understanding HTTP/2 Settings”Stream and Connection Management
Section titled “Stream and Connection Management”MaxStreamsPerConnection: Controls how many requests can be processed concurrently over a single HTTP/2 connection. Higher values improve throughput for clients making many concurrent requests but increase server memory usage.
Header Compression
Section titled “Header Compression”HeaderTableSize: Controls the HPACK compression table size. Larger values can improve compression efficiency for connections with repetitive headers but use more memory.MaxRequestHeaderFieldSize: Limits individual header field sizes to prevent resource exhaustion attacks.
Flow Control
Section titled “Flow Control”MaxFrameSize: Larger frame sizes can improve throughput by reducing overhead but may increase latency for multiplexed streams.InitialConnectionWindowSizeandInitialStreamWindowSize: Control HTTP/2 flow control windows. Larger values allow more data to be in-flight before receiving acknowledgments, improving throughput on high-bandwidth, high-latency connections.
Keep-Alive Settings
Section titled “Keep-Alive Settings”KeepAlivePingDelay: When set, the server periodically sends HTTP/2 PING frames to detect disconnected clients. This is useful for long-lived connections but adds overhead.KeepAlivePingTimeout: The maximum time to wait for a PING response before considering the connection dead.
Examples
Section titled “Examples”The following examples show the Http2 section within HAKOM:TSM:Http:Hosting:Limits.
Basic HTTP/2 configuration
Section titled “ Basic HTTP/2 configuration”Configure HTTP/2 settings for high-throughput scenarios:
<Limits> <Http2> <MaxStreamsPerConnection>200</MaxStreamsPerConnection> <HeaderTableSize>8192</HeaderTableSize> <MaxFrameSize>32768</MaxFrameSize> <MaxRequestHeaderFieldSize>16384</MaxRequestHeaderFieldSize> <InitialConnectionWindowSize>262144</InitialConnectionWindowSize> <InitialStreamWindowSize>196608</InitialStreamWindowSize> </Http2></Limits>HTTP/2 with keep-alive pings
Section titled “ HTTP/2 with keep-alive pings”Configure HTTP/2 with keep-alive pings enabled for long-lived connections:
<Limits> <Http2> <MaxStreamsPerConnection>150</MaxStreamsPerConnection> <KeepAlivePingDelay>00:01:00</KeepAlivePingDelay> <KeepAlivePingTimeout>00:00:30</KeepAlivePingTimeout> </Http2></Limits>Conservative HTTP/2 limits
Section titled “ Conservative HTTP/2 limits”Configure conservative HTTP/2 limits for resource-constrained environments:
<Limits> <Http2> <MaxStreamsPerConnection>50</MaxStreamsPerConnection> <HeaderTableSize>4096</HeaderTableSize> <MaxFrameSize>16384</MaxFrameSize> <MaxRequestHeaderFieldSize>4096</MaxRequestHeaderFieldSize> <InitialConnectionWindowSize>65536</InitialConnectionWindowSize> <InitialStreamWindowSize>65536</InitialStreamWindowSize> </Http2></Limits>Important Notes
Section titled “Important Notes”Was this page helpful?Thanks for your feedback!