Merge pull request #14 from markhpc/wip-idle-connections

hsbench: Limit idle connections to 2x the thread count.
master
Mark Nelson 2019-08-27 07:44:23 -05:00 committed by GitHub
commit ffff811a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -54,10 +54,10 @@ var HTTPTransport http.RoundTripper = &http.Transport{
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 0,
// Allow an unlimited number of idle connections
MaxIdleConnsPerHost: 4096,
MaxIdleConns: 0,
// But limit their idle time
// Set the number of idle connections to 2X the number of threads
MaxIdleConnsPerHost: 2*threads,
MaxIdleConns: 2*threads,
// But limit their idle time to 1 minute
IdleConnTimeout: time.Minute,
// Ignore TLS errors
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},