[Distributed] Fix init serialToParallelPool bug if cpu.cores > 100#2362
Conversation
There was a problem hiding this comment.
Good Job! besides, envy that you have more than 100 cores servers~
But what about the server's CPUs less than the allNodes.size()?
I think we can reference the code when creating RaftServer[1]
int maxConcurrentClientNum = Math.max(CommonUtils.getCpuCores(), config.getMaxConcurrentClientNum()); TThreadPoolServer.Args poolArgs = new TThreadPoolServer.Args(socket).maxWorkerThreads(maxConcurrentClientNum) .minWorkerThreads(CommonUtils.getCpuCores());
[1]
https://github.com/apache/iotdb/blob/master/cluster/src/main/java/org/apache/iotdb/cluster/utils/ClusterUtils.java#L242
Scale up is too nice, I've forgotten how to scale out~ |
You are right.But I think the core size can be smaller than cpu.core. What about this? |
LGTM |
|
Kudos, SonarCloud Quality Gate passed!
|
We will encounter a exception when starting cluster server if cpu.cores > 100, so we should change the parameters for
ThreadPoolExecutor. AsserialToParallelPoolwill only do heartbeat or add/remove node, I think the coreSize can be 'allNode.size()', and the maxSize can be set toMath.max(allNodes.size(), Runtime.getRuntime().availableProcessors()).