Преглед на файлове

auto update script executed

Toby Chui преди 1 година
родител
ревизия
2d56f1560d
променени са 1 файла, в които са добавени 5 реда и са изтрити 4 реда
  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 {