http2_max_concurrent_streams
Sets the maximum number of concurrent streams that can be established on a single HTTP/2 connection.
Description
The http2_max_concurrent_streams directive is used to define the maximum number of concurrent streams that can be open at any given time on a single HTTP/2 connection. This directive can be configured on both http and server context which allows for granular control over how many simultaneous requests can be processed over a single connection to the server.
By specifying an integer value for this directive, you can control the load and performance behavior of HTTP/2 traffic handled by NGINX. Setting a higher limit may improve throughput by allowing more simultaneous requests, but could also place a higher burden on server resources, especially under heavy traffic conditions. Conversely, a lower limit can prevent the server from being overwhelmed but may result in increased latency for end-users as requests must wait for available streams.
The parameter is an integer that specifies the number of concurrent streams. It's important to monitor server performance and adjust this value as needed based on load testing and actual traffic patterns.
Config Example
http {
http2_max_concurrent_streams 64;
}
server {
listen 443 ssl http2;
server_name example.com;
http2_max_concurrent_streams 100;
}Setting a value too high may exhaust server resources, leading to degraded performance.
If not supported by the client, increasing streams won't have any effect; ensure client compatibility with HTTP/2.