UN-5213: Increase MaxStreams value for QUIC transport
The default max streams value of 100 is rather small when subject to high load in terms of connecting QUIC with streams faster than it can create new ones. This high value allows for more throughput.
This commit is contained in:
		
							parent
							
								
									7059ef8e13
								
							
						
					
					
						commit
						bccf4a63dc
					
				|  | @ -4,6 +4,7 @@ import ( | ||||||
| 	"context" | 	"context" | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"io" | 	"io" | ||||||
|  | 	"math" | ||||||
| 	"net/http" | 	"net/http" | ||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"strings" | 	"strings" | ||||||
|  | @ -19,6 +20,7 @@ const ( | ||||||
| 	lbProbeUserAgentPrefix = "Mozilla/5.0 (compatible; Cloudflare-Traffic-Manager/1.0; +https://www.cloudflare.com/traffic-manager/;" | 	lbProbeUserAgentPrefix = "Mozilla/5.0 (compatible; Cloudflare-Traffic-Manager/1.0; +https://www.cloudflare.com/traffic-manager/;" | ||||||
| 	LogFieldConnIndex      = "connIndex" | 	LogFieldConnIndex      = "connIndex" | ||||||
| 	MaxGracePeriod         = time.Minute * 3 | 	MaxGracePeriod         = time.Minute * 3 | ||||||
|  | 	MaxConcurrentStreams   = math.MaxUint32 | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| var switchingProtocolText = fmt.Sprintf("%d %s", http.StatusSwitchingProtocols, http.StatusText(http.StatusSwitchingProtocols)) | var switchingProtocolText = fmt.Sprintf("%d %s", http.StatusSwitchingProtocols, http.StatusText(http.StatusSwitchingProtocols)) | ||||||
|  |  | ||||||
|  | @ -4,7 +4,6 @@ import ( | ||||||
| 	"context" | 	"context" | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"io" | 	"io" | ||||||
| 	"math" |  | ||||||
| 	"net" | 	"net" | ||||||
| 	"net/http" | 	"net/http" | ||||||
| 	"runtime/debug" | 	"runtime/debug" | ||||||
|  | @ -60,7 +59,7 @@ func NewHTTP2Connection( | ||||||
| 	return &HTTP2Connection{ | 	return &HTTP2Connection{ | ||||||
| 		conn: conn, | 		conn: conn, | ||||||
| 		server: &http2.Server{ | 		server: &http2.Server{ | ||||||
| 			MaxConcurrentStreams: math.MaxUint32, | 			MaxConcurrentStreams: MaxConcurrentStreams, | ||||||
| 		}, | 		}, | ||||||
| 		config:               config, | 		config:               config, | ||||||
| 		connOptions:          connOptions, | 		connOptions:          connOptions, | ||||||
|  |  | ||||||
|  | @ -358,7 +358,6 @@ func serveTunnel( | ||||||
| 			config, | 			config, | ||||||
| 			connOptions, | 			connOptions, | ||||||
| 			controlStream, | 			controlStream, | ||||||
| 			connectedFuse, |  | ||||||
| 			reconnectCh, | 			reconnectCh, | ||||||
| 			gracefulShutdownC) | 			gracefulShutdownC) | ||||||
| 
 | 
 | ||||||
|  | @ -509,7 +508,6 @@ func ServeQUIC( | ||||||
| 	config *TunnelConfig, | 	config *TunnelConfig, | ||||||
| 	connOptions *tunnelpogs.ConnectionOptions, | 	connOptions *tunnelpogs.ConnectionOptions, | ||||||
| 	controlStreamHandler connection.ControlStreamHandler, | 	controlStreamHandler connection.ControlStreamHandler, | ||||||
| 	connectedFuse connection.ConnectedFuse, |  | ||||||
| 	reconnectCh chan ReconnectSignal, | 	reconnectCh chan ReconnectSignal, | ||||||
| 	gracefulShutdownC <-chan struct{}, | 	gracefulShutdownC <-chan struct{}, | ||||||
| ) (err error, recoverable bool) { | ) (err error, recoverable bool) { | ||||||
|  | @ -517,6 +515,8 @@ func ServeQUIC( | ||||||
| 	quicConfig := &quic.Config{ | 	quicConfig := &quic.Config{ | ||||||
| 		HandshakeIdleTimeout:  quicHandshakeIdleTimeout, | 		HandshakeIdleTimeout:  quicHandshakeIdleTimeout, | ||||||
| 		MaxIdleTimeout:        quicMaxIdleTimeout, | 		MaxIdleTimeout:        quicMaxIdleTimeout, | ||||||
|  | 		MaxIncomingStreams:    connection.MaxConcurrentStreams, | ||||||
|  | 		MaxIncomingUniStreams: connection.MaxConcurrentStreams, | ||||||
| 		KeepAlive:             true, | 		KeepAlive:             true, | ||||||
| 	} | 	} | ||||||
| 	for { | 	for { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue