Skip to content

Commit

Permalink
Merge pull request #2888 from areyouok/dev_speed_D
Browse files Browse the repository at this point in the history
[ISSUE #2883] [Part D] Improve produce performance in M/S mode.
  • Loading branch information
duhenglucky committed Jun 18, 2021
2 parents a92996a + 5fe0041 commit e5a3f7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Expand Up @@ -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();
Expand All @@ -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;

Expand Down
Expand Up @@ -54,13 +54,12 @@ public class MessageStoreConfig {

/**
* introduced since 4.0.x. Determine whether to use mutex reentrantLock when putting message.<br/>
* 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
Expand Down

0 comments on commit e5a3f7d

Please sign in to comment.