Skip to content

Commit

Permalink
Fix cos client MaxIdleConnsPerHost too low (thanos-io#4479)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjm committed Jul 24, 2021
1 parent 986c3cc commit 2869228
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/objstore/cos/cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"io"
"net"
"net/http"
"os"
"strings"
Expand Down Expand Up @@ -78,6 +79,19 @@ func NewBucket(logger log.Logger, conf []byte, component string) (*Bucket, error
Transport: &cos.AuthorizationTransport{
SecretID: config.SecretId,
SecretKey: config.SecretKey,
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).DialContext,
ForceAttemptHTTP2: true,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
MaxIdleConnsPerHost: 100,
},
},
})

Expand Down

0 comments on commit 2869228

Please sign in to comment.