Set number of cores explicitly if it is not specified and add TODO for core list
This commit is contained in:
@ -69,6 +69,7 @@ func printClientConfig(config *testpb.ClientConfig) {
|
||||
// - core list
|
||||
grpclog.Printf(" * client type: %v (ignored, always creates sync client)", config.ClientType)
|
||||
grpclog.Printf(" * async client threads: %v (ignored)", config.AsyncClientThreads)
|
||||
// TODO: use cores specified by CoreList when setting list of cores is supported in go.
|
||||
grpclog.Printf(" * core list: %v (ignored)", config.CoreList)
|
||||
|
||||
grpclog.Printf(" - security params: %v", config.SecurityParams)
|
||||
@ -87,6 +88,8 @@ func setupClientEnv(config *testpb.ClientConfig) {
|
||||
// TODO: Revisit this for the optimal default setup.
|
||||
if config.CoreLimit > 0 {
|
||||
runtime.GOMAXPROCS(int(config.CoreLimit))
|
||||
} else {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,7 @@ func printServerConfig(config *testpb.ServerConfig) {
|
||||
// - core list
|
||||
grpclog.Printf(" * server type: %v (ignored, always starts sync server)", config.ServerType)
|
||||
grpclog.Printf(" * async server threads: %v (ignored)", config.AsyncServerThreads)
|
||||
// TODO: use cores specified by CoreList when setting list of cores is supported in go.
|
||||
grpclog.Printf(" * core list: %v (ignored)", config.CoreList)
|
||||
|
||||
grpclog.Printf(" - security params: %v", config.SecurityParams)
|
||||
@ -86,8 +87,8 @@ func startBenchmarkServer(config *testpb.ServerConfig, serverPort int) (*benchma
|
||||
numOfCores := runtime.NumCPU()
|
||||
if config.CoreLimit > 0 {
|
||||
numOfCores = int(config.CoreLimit)
|
||||
runtime.GOMAXPROCS(numOfCores)
|
||||
}
|
||||
runtime.GOMAXPROCS(numOfCores)
|
||||
|
||||
var opts []grpc.ServerOption
|
||||
|
||||
|
Reference in New Issue
Block a user