GOMAXPROCS usage instead of NumCPU (#1801)

This commit is contained in:
Alexey Makhov 2021-06-29 05:37:08 +03:00 committed by GitHub
parent e757f78923
commit b7d23d446c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@ func (opt *ClusterOptions) init() {
}
if opt.PoolSize == 0 {
opt.PoolSize = 5 * runtime.NumCPU()
opt.PoolSize = 5 * runtime.GOMAXPROCS(0)
}
switch opt.ReadTimeout {

View File

@ -77,7 +77,7 @@ type Options struct {
WriteTimeout time.Duration
// Maximum number of socket connections.
// Default is 10 connections per every CPU as reported by runtime.NumCPU.
// Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.
PoolSize int
// Minimum number of idle connections which is useful when establishing
// new connection is slow.
@ -136,7 +136,7 @@ func (opt *Options) init() {
}
}
if opt.PoolSize == 0 {
opt.PoolSize = 10 * runtime.NumCPU()
opt.PoolSize = 10 * runtime.GOMAXPROCS(0)
}
switch opt.ReadTimeout {
case -1: