From 688cde2a78623199b5eb193979999c72e871e7c5 Mon Sep 17 00:00:00 2001 From: fanpei-tes Date: Fri, 28 Aug 2020 11:21:58 +0800 Subject: [PATCH] auzre blob: don't handshake timeout --- cmd/gateway/azure/gateway-azure.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/gateway/azure/gateway-azure.go b/cmd/gateway/azure/gateway-azure.go index cb3836816c360..6a382bc9d2668 100644 --- a/cmd/gateway/azure/gateway-azure.go +++ b/cmd/gateway/azure/gateway-azure.go @@ -25,6 +25,7 @@ import ( "encoding/json" "fmt" "io" + "net" "net/http" "path" "sort" @@ -191,7 +192,14 @@ func (g *Azure) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, erro } c.AddToUserAgent(fmt.Sprintf("APN/1.0 MinIO/1.0 MinIO/%s", minio.Version)) - c.HTTPClient = &http.Client{Transport: minio.NewCustomHTTPTransport()} + transport := minio.NewCustomHTTPTransport() + transport.DialContext = (&net.Dialer{ + KeepAlive: 60 * time.Minute, + }).DialContext + transport.TLSHandshakeTimeout = 0 + transport.ExpectContinueTimeout = 0 + transport.MaxIdleConnsPerHost = 24 + c.HTTPClient = &http.Client{Transport: transport} return &azureObjects{ client: c.GetBlobService(),