Skip to content

Commit b7d23d4

Browse files
authored
GOMAXPROCS usage instead of NumCPU (#1801)
1 parent e757f78 commit b7d23d4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (opt *ClusterOptions) init() {
9191
}
9292

9393
if opt.PoolSize == 0 {
94-
opt.PoolSize = 5 * runtime.NumCPU()
94+
opt.PoolSize = 5 * runtime.GOMAXPROCS(0)
9595
}
9696

9797
switch opt.ReadTimeout {

options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type Options struct {
7777
WriteTimeout time.Duration
7878

7979
// Maximum number of socket connections.
80-
// Default is 10 connections per every CPU as reported by runtime.NumCPU.
80+
// Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.
8181
PoolSize int
8282
// Minimum number of idle connections which is useful when establishing
8383
// new connection is slow.
@@ -136,7 +136,7 @@ func (opt *Options) init() {
136136
}
137137
}
138138
if opt.PoolSize == 0 {
139-
opt.PoolSize = 10 * runtime.NumCPU()
139+
opt.PoolSize = 10 * runtime.GOMAXPROCS(0)
140140
}
141141
switch opt.ReadTimeout {
142142
case -1:

0 commit comments

Comments
 (0)