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

lollipopjin pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 84fc240acc [ISSUE #10462] Optimize thread pool sizes for commit and 
fetch executors (#10472)
84fc240acc is described below

commit 84fc240accc384e576a87873347701065a3ad433
Author: lizhimins <[email protected]>
AuthorDate: Thu Jun 11 19:21:09 2026 +0800

    [ISSUE #10462] Optimize thread pool sizes for commit and fetch executors 
(#10472)
---
 .../apache/rocketmq/tieredstore/MessageStoreExecutor.java | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git 
a/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/MessageStoreExecutor.java
 
b/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/MessageStoreExecutor.java
index 56f564e7d2..d51b5dc420 100644
--- 
a/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/MessageStoreExecutor.java
+++ 
b/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/MessageStoreExecutor.java
@@ -48,31 +48,32 @@ public class MessageStoreExecutor {
     }
 
     public MessageStoreExecutor(int maxQueueCapacity) {
+        int processors = Runtime.getRuntime().availableProcessors();
 
         this.commonExecutor = ThreadUtils.newScheduledThreadPool(
-            Math.max(4, Runtime.getRuntime().availableProcessors()),
+            Math.max(4, processors),
             new ThreadFactoryImpl("TieredCommonExecutor_"));
 
         this.bufferCommitThreadPoolQueue = new 
LinkedBlockingQueue<>(maxQueueCapacity);
         this.bufferCommitExecutor = ThreadUtils.newThreadPoolExecutor(
-            Math.max(16, Runtime.getRuntime().availableProcessors() * 4),
-            Math.max(16, Runtime.getRuntime().availableProcessors() * 4),
+            Math.max(4, processors),
+            Math.max(16, processors * 2),
             TimeUnit.MINUTES.toMillis(1), TimeUnit.MILLISECONDS,
             this.bufferCommitThreadPoolQueue,
             new ThreadFactoryImpl("BufferCommitExecutor_"));
 
         this.bufferFetchThreadPoolQueue = new 
LinkedBlockingQueue<>(maxQueueCapacity);
         this.bufferFetchExecutor = ThreadUtils.newThreadPoolExecutor(
-            Math.max(16, Runtime.getRuntime().availableProcessors() * 4),
-            Math.max(16, Runtime.getRuntime().availableProcessors() * 4),
+            Math.max(4, processors),
+            Math.max(16, processors * 2),
             TimeUnit.MINUTES.toMillis(1), TimeUnit.MILLISECONDS,
             this.bufferFetchThreadPoolQueue,
             new ThreadFactoryImpl("BufferFetchExecutor_"));
 
         this.fileRecyclingThreadPoolQueue = new 
LinkedBlockingQueue<>(maxQueueCapacity);
         this.fileRecyclingExecutor = ThreadUtils.newThreadPoolExecutor(
-            Math.max(4, Runtime.getRuntime().availableProcessors()),
-            Math.max(4, Runtime.getRuntime().availableProcessors()),
+            Math.max(4, processors),
+            Math.max(4, processors),
             TimeUnit.MINUTES.toMillis(1), TimeUnit.MILLISECONDS,
             this.fileRecyclingThreadPoolQueue,
             new ThreadFactoryImpl("BufferFetchExecutor_"));

Reply via email to