Skip to content

Commit b6ce084

Browse files
authored
[internal] Optimize HTTP transport params (#222)
Since these calls are all made to the same host, persisting connections and specifying the timeouts yields performance and throughput improvements.
1 parent 16bce7d commit b6ce084

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/api.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ var (
5858

5959
apiHTTPClient = &http.Client{
6060
Transport: &http.Transport{
61-
Proxy: http.ProxyFromEnvironment,
62-
Dial: limitDial,
61+
Proxy: http.ProxyFromEnvironment,
62+
Dial: limitDial,
63+
MaxIdleConns: 1000,
64+
MaxIdleConnsPerHost: 10000,
65+
IdleConnTimeout: 90 * time.Second,
6366
},
6467
}
6568

0 commit comments

Comments
 (0)