Explicitly set default cpu number to 1

This commit is contained in:
Menghan Li
2016-05-04 11:55:36 -07:00
parent 78994035bc
commit ac8e82e9d0
2 changed files with 3 additions and 1 deletions

View File

@ -87,6 +87,8 @@ func setupClientEnv(config *testpb.ClientConfig) {
// TODO: change default number of cores used if 1 is not fastest.
if config.CoreLimit > 1 {
runtime.GOMAXPROCS(int(config.CoreLimit))
} else {
runtime.GOMAXPROCS(1)
}
}

View File

@ -85,8 +85,8 @@ func startBenchmarkServer(config *testpb.ServerConfig, serverPort int) (*benchma
numOfCores := 1
if config.CoreLimit > 1 {
numOfCores = int(config.CoreLimit)
runtime.GOMAXPROCS(numOfCores)
}
runtime.GOMAXPROCS(numOfCores)
var opts []grpc.ServerOption