From d9cfad18945e90880b4c9887e436d7450b90d64b Mon Sep 17 00:00:00 2001 From: Rustam Zagirov Date: Thu, 31 Oct 2019 15:13:38 +0300 Subject: [PATCH] add configuration for http2_max_concurrent_streams --- docs/user-guide/nginx-configuration/configmap.md | 8 ++++++++ internal/ingress/controller/config/config.go | 5 +++++ rootfs/etc/nginx/template/nginx.tmpl | 1 + 3 files changed, 14 insertions(+) diff --git a/docs/user-guide/nginx-configuration/configmap.md b/docs/user-guide/nginx-configuration/configmap.md index 1ab43dd280..448ad96df8 100755 --- a/docs/user-guide/nginx-configuration/configmap.md +++ b/docs/user-guide/nginx-configuration/configmap.md @@ -51,6 +51,7 @@ The following table shows a configuration option's name, type, and the default v |[http2-max-field-size](#http2-max-field-size)|string|"4k"| |[http2-max-header-size](#http2-max-header-size)|string|"16k"| |[http2-max-requests](#http2-max-requests)|int|1000| +|[http2-max-concurrent-streams](#http2-max-concurrent-streams)|int|1000| |[hsts](#hsts)|bool|"true"| |[hsts-include-subdomains](#hsts-include-subdomains)|bool|"true"| |[hsts-max-age](#hsts-max-age)|string|"15724800"| @@ -310,6 +311,13 @@ Sets the maximum number of requests (including push requests) that can be served _References:_ [http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_requests](http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_requests) +## http2-max-concurrent-streams + +Sets the maximum number of concurrent HTTP/2 streams in a connection. + +_References:_ +[http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_concurrent_streams](http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_concurrent_streams) + ## hsts Enables or disables the header HSTS in servers running SSL. diff --git a/internal/ingress/controller/config/config.go b/internal/ingress/controller/config/config.go index 2683ede21c..fa456f8285 100644 --- a/internal/ingress/controller/config/config.go +++ b/internal/ingress/controller/config/config.go @@ -196,6 +196,10 @@ type Configuration struct { // and the need of establishing a new connection. HTTP2MaxRequests int `json:"http2-max-requests,omitempty"` + // http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_concurrent_streams + // Sets the maximum number of concurrent HTTP/2 streams in a connection. + HTTP2MaxConcurrentStreams int `json:"http2-max-concurrent-streams,omitempty"` + // Enables or disables the header HSTS in servers running SSL HSTS bool `json:"hsts,omitempty"` @@ -676,6 +680,7 @@ func NewDefault() Configuration { HTTP2MaxFieldSize: "4k", HTTP2MaxHeaderSize: "16k", HTTP2MaxRequests: 1000, + HTTP2MaxConcurrentStreams: 128, HTTPRedirectCode: 308, HSTS: true, HSTSIncludeSubdomains: true, diff --git a/rootfs/etc/nginx/template/nginx.tmpl b/rootfs/etc/nginx/template/nginx.tmpl index 2b646cd719..74c1758588 100755 --- a/rootfs/etc/nginx/template/nginx.tmpl +++ b/rootfs/etc/nginx/template/nginx.tmpl @@ -210,6 +210,7 @@ http { http2_max_field_size {{ $cfg.HTTP2MaxFieldSize }}; http2_max_header_size {{ $cfg.HTTP2MaxHeaderSize }}; http2_max_requests {{ $cfg.HTTP2MaxRequests }}; + http2_max_concurrent_streams {{ $cfg.HTTP2MaxConcurrentStreams }}; types_hash_max_size 2048; server_names_hash_max_size {{ $cfg.ServerNameHashMaxSize }};