Skip to content

Commit

Permalink
[internal] Optimize HTTP transport params (#222)
Browse files Browse the repository at this point in the history
Since these calls are all made to the same host, persisting connections
and specifying the timeouts yields performance and throughput improvements.
  • Loading branch information
roffjulie committed Dec 19, 2019
1 parent 16bce7d commit b6ce084
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ var (

apiHTTPClient = &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
Dial: limitDial,
Proxy: http.ProxyFromEnvironment,
Dial: limitDial,
MaxIdleConns: 1000,
MaxIdleConnsPerHost: 10000,
IdleConnTimeout: 90 * time.Second,
},
}

Expand Down

0 comments on commit b6ce084

Please sign in to comment.