diff --git a/common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java b/common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java index d80b3d2169b13e9c8a5a439b02bd726763a20283..f710cdb40307bbafc31f63046ba95966c52eb873 100644 --- a/common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java +++ b/common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java @@ -57,10 +57,9 @@ public class BrokerConfig { @ImportantField private boolean traceTopicEnable = false; /** - * thread numbers for send message thread pool, since spin lock will be used by default since 4.0.x, the default - * value is 1. + * thread numbers for send message thread pool. */ - private int sendMessageThreadPoolNums = 1; //16 + Runtime.getRuntime().availableProcessors() * 4; + private int sendMessageThreadPoolNums = Math.min(Runtime.getRuntime().availableProcessors(), 4); private int pullMessageThreadPoolNums = 16 + Runtime.getRuntime().availableProcessors() * 2; private int processReplyMessageThreadPoolNums = 16 + Runtime.getRuntime().availableProcessors() * 2; private int queryMessageThreadPoolNums = 8 + Runtime.getRuntime().availableProcessors(); @@ -73,7 +72,8 @@ public class BrokerConfig { /** * Thread numbers for EndTransactionProcessor */ - private int endTransactionThreadPoolNums = 8 + Runtime.getRuntime().availableProcessors() * 2; + private int endTransactionThreadPoolNums = Math.max(8 + Runtime.getRuntime().availableProcessors() * 2, + sendMessageThreadPoolNums * 4); private int flushConsumerOffsetInterval = 1000 * 5; diff --git a/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java b/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java index c13ad4cfa22be8a5829075523b2d4e96510ca558..978e85baca0122dbf0efeff4b153b4afcfb99460 100644 --- a/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java +++ b/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java @@ -54,13 +54,12 @@ public class MessageStoreConfig { /** * introduced since 4.0.x. Determine whether to use mutex reentrantLock when putting message.
- * By default it is set to false indicating using spin lock when putting message. */ - private boolean useReentrantLockWhenPutMessage = false; + private boolean useReentrantLockWhenPutMessage = true; - // Whether schedule flush,default is real-time + // Whether schedule flush @ImportantField - private boolean flushCommitLogTimed = false; + private boolean flushCommitLogTimed = true; // ConsumeQueue flush interval private int flushIntervalConsumeQueue = 1000; // Resource reclaim interval