We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7f0c3bc + c6944a8 commit 117fed9Copy full SHA for 117fed9
options.go
@@ -6,6 +6,7 @@ import (
6
"fmt"
7
"net"
8
"net/url"
9
+ "runtime"
10
"strconv"
11
"strings"
12
"time"
@@ -54,7 +55,7 @@ type Options struct {
54
55
WriteTimeout time.Duration
56
57
// Maximum number of socket connections.
- // Default is 10 connections.
58
+ // Default is 10 connections per every CPU as reported by runtime.NumCPU.
59
PoolSize int
60
// Amount of time client waits for connection if all connections
61
// are busy before returning an error.
@@ -91,7 +92,7 @@ func (opt *Options) init() {
91
92
}
93
94
if opt.PoolSize == 0 {
- opt.PoolSize = 10
95
+ opt.PoolSize = 10 * runtime.NumCPU()
96
97
if opt.DialTimeout == 0 {
98
opt.DialTimeout = 5 * time.Second
0 commit comments