Browse Source

auto update script executed

Toby Chui 1 year ago
parent
commit
2d56f1560d
1 changed files with 5 additions and 4 deletions
  1. 5 4
      mod/dynamicproxy/dpcore/dpcore.go

+ 5 - 4
mod/dynamicproxy/dpcore/dpcore.go

@@ -91,10 +91,11 @@ func NewDynamicProxyCore(target *url.URL, prepender string, ignoreTLSVerificatio
 
 	//Hack the default transporter to handle more connections
 	thisTransporter := http.DefaultTransport
-	thisTransporter.(*http.Transport).MaxIdleConns = 0
-	thisTransporter.(*http.Transport).MaxIdleConnsPerHost = 3000
-	thisTransporter.(*http.Transport).IdleConnTimeout = 30 * time.Second
-	thisTransporter.(*http.Transport).MaxConnsPerHost = 0
+	optimalConcurrentConnection := 32
+	thisTransporter.(*http.Transport).MaxIdleConns = optimalConcurrentConnection + 3
+	thisTransporter.(*http.Transport).MaxIdleConnsPerHost = optimalConcurrentConnection
+	thisTransporter.(*http.Transport).IdleConnTimeout = 60 * time.Second
+	thisTransporter.(*http.Transport).MaxConnsPerHost = optimalConcurrentConnection + 3
 	thisTransporter.(*http.Transport).DisableCompression = true
 
 	if ignoreTLSVerification {