You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/07/14 15:03:58 UTC

[iotdb] branch iotdb-3791 updated: turn up thread number of ThreadPoolMinWorker

This is an automated email from the ASF dual-hosted git repository.

xingtanzjr pushed a commit to branch iotdb-3791
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/iotdb-3791 by this push:
     new 1703b35687 turn up thread number of ThreadPoolMinWorker
1703b35687 is described below

commit 1703b35687b8e9c9bad27b8dc6d34bca0b8ae2c7
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Thu Jul 14 23:03:38 2022 +0800

    turn up thread number of ThreadPoolMinWorker
---
 .../iotdb/consensus/config/MultiLeaderConfig.java  |  2 +-
 .../service/MultiLeaderRPCServiceProcessor.java    | 28 +++++++++++-----------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/config/MultiLeaderConfig.java b/consensus/src/main/java/org/apache/iotdb/consensus/config/MultiLeaderConfig.java
index 6383684545..7cf014e990 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/config/MultiLeaderConfig.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/config/MultiLeaderConfig.java
@@ -132,7 +132,7 @@ public class MultiLeaderConfig {
 
     public static class Builder {
       private int rpcSelectorThreadNum = 1;
-      private int rpcMinConcurrentClientNum = Runtime.getRuntime().availableProcessors();
+      private int rpcMinConcurrentClientNum = 16;
       private int rpcMaxConcurrentClientNum = 65535;
       private int thriftServerAwaitTimeForStopService = 60;
       private boolean isRpcThriftCompressionEnabled = false;
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java
index e0ddd7f256..36c040c983 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/service/MultiLeaderRPCServiceProcessor.java
@@ -73,21 +73,21 @@ public class MultiLeaderRPCServiceProcessor implements MultiLeaderConsensusIServ
       StepTracker.trace("syncLogPrepare", 10, prepareStartTime, System.nanoTime());
       // We use synchronized to ensure atomicity of executing multiple logs
       long lockWaitingStartTime = System.nanoTime();
-      synchronized (impl.getStateMachine()) {
-        StepTracker.trace("syncLogWaitingLock", 10, lockWaitingStartTime, System.nanoTime());
-        StepTracker.trace("req.getBatches().size()", 10, 0, req.getBatches().size() * 1000_000L);
-        for (TLogBatch batch : req.getBatches()) {
-          long writeOneBatch = System.nanoTime();
-          statuses.add(
-              impl.getStateMachine()
-                  .write(
-                      impl.buildIndexedConsensusRequestForRemoteRequest(
-                          batch.isFromWAL()
-                              ? new MultiLeaderConsensusRequest(batch.data)
-                              : new ByteBufferConsensusRequest(batch.data))));
-          StepTracker.trace("writeOneBatch", 400, writeOneBatch, System.nanoTime());
-        }
+      //      synchronized (impl.getStateMachine()) {
+      StepTracker.trace("syncLogWaitingLock", 10, lockWaitingStartTime, System.nanoTime());
+      StepTracker.trace("req.getBatches().size()", 10, 0, req.getBatches().size() * 1000_000L);
+      for (TLogBatch batch : req.getBatches()) {
+        long writeOneBatch = System.nanoTime();
+        statuses.add(
+            impl.getStateMachine()
+                .write(
+                    impl.buildIndexedConsensusRequestForRemoteRequest(
+                        batch.isFromWAL()
+                            ? new MultiLeaderConsensusRequest(batch.data)
+                            : new ByteBufferConsensusRequest(batch.data))));
+        StepTracker.trace("writeOneBatch", 400, writeOneBatch, System.nanoTime());
       }
+      //      }
       logger.debug("Execute TSyncLogReq for {} with result {}", req.consensusGroupId, statuses);
       resultHandler.onComplete(new TSyncLogRes(statuses));
     } catch (Exception e) {