Merge pull request #14 from markhpc/wip-idle-connections
hsbench: Limit idle connections to 2x the thread count.master
commit
ffff811a2b
|
@ -54,10 +54,10 @@ var HTTPTransport http.RoundTripper = &http.Transport{
|
||||||
}).Dial,
|
}).Dial,
|
||||||
TLSHandshakeTimeout: 10 * time.Second,
|
TLSHandshakeTimeout: 10 * time.Second,
|
||||||
ExpectContinueTimeout: 0,
|
ExpectContinueTimeout: 0,
|
||||||
// Allow an unlimited number of idle connections
|
// Set the number of idle connections to 2X the number of threads
|
||||||
MaxIdleConnsPerHost: 4096,
|
MaxIdleConnsPerHost: 2*threads,
|
||||||
MaxIdleConns: 0,
|
MaxIdleConns: 2*threads,
|
||||||
// But limit their idle time
|
// But limit their idle time to 1 minute
|
||||||
IdleConnTimeout: time.Minute,
|
IdleConnTimeout: time.Minute,
|
||||||
// Ignore TLS errors
|
// Ignore TLS errors
|
||||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||||
|
|
Loading…
Reference in New Issue