Skip to content

Commit

Permalink
Set MaxIdleConnsPerHost to 100
Browse files Browse the repository at this point in the history
  • Loading branch information
errordeveloper committed Nov 24, 2017
1 parent e217b71 commit 1f74477
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions util/httputil/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ func NewClientFromConfig(cfg config.HTTPClientConfig, name string) (*http.Client
// The only timeout we care about is the configured scrape timeout.
// It is applied on request. So we leave out any timings here.
var rt http.RoundTripper = &http.Transport{
Proxy: http.ProxyURL(cfg.ProxyURL.URL),
MaxIdleConns: 20000,
DisableKeepAlives: false,
TLSClientConfig: tlsConfig,
DisableCompression: true,
Proxy: http.ProxyURL(cfg.ProxyURL.URL),
MaxIdleConns: 20000,
MaxIdleConnsPerHost: 100,
DisableKeepAlives: false,
TLSClientConfig: tlsConfig,
DisableCompression: true,
// 5 minutes is typically above the maximum sane scrape interval. So we can
// use keepalive for all configurations.
IdleConnTimeout: 5 * time.Minute,
Expand Down

0 comments on commit 1f74477

Please sign in to comment.