mirror of https://github.com/go-redis/redis.git
GOMAXPROCS usage instead of NumCPU (#1801)
This commit is contained in:
parent
e757f78923
commit
b7d23d446c
|
@ -91,7 +91,7 @@ func (opt *ClusterOptions) init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if opt.PoolSize == 0 {
|
if opt.PoolSize == 0 {
|
||||||
opt.PoolSize = 5 * runtime.NumCPU()
|
opt.PoolSize = 5 * runtime.GOMAXPROCS(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch opt.ReadTimeout {
|
switch opt.ReadTimeout {
|
||||||
|
|
|
@ -77,7 +77,7 @@ type Options struct {
|
||||||
WriteTimeout time.Duration
|
WriteTimeout time.Duration
|
||||||
|
|
||||||
// Maximum number of socket connections.
|
// 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
|
PoolSize int
|
||||||
// Minimum number of idle connections which is useful when establishing
|
// Minimum number of idle connections which is useful when establishing
|
||||||
// new connection is slow.
|
// new connection is slow.
|
||||||
|
@ -136,7 +136,7 @@ func (opt *Options) init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if opt.PoolSize == 0 {
|
if opt.PoolSize == 0 {
|
||||||
opt.PoolSize = 10 * runtime.NumCPU()
|
opt.PoolSize = 10 * runtime.GOMAXPROCS(0)
|
||||||
}
|
}
|
||||||
switch opt.ReadTimeout {
|
switch opt.ReadTimeout {
|
||||||
case -1:
|
case -1:
|
||||||
|
|
Loading…
Reference in New Issue