Skip to content

Commit a41c36d

Browse files
committed
异步调用和oneway调用,信号量调整为2048, 因为有可能某个消费者分配的队列大于信号量,就会导致拉消息效率下降,甚至延时。
修改为2048,同时也会带来坏处, 异步调用的流控阀值会变大, 流控效果下降, 如果客户端调用tps超出服务器处理能力, 可能会触发服务器流控。
1 parent c0e93ef commit a41c36d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rocketmq-remoting/src/main/java/com/alibaba/rocketmq/remoting/netty/NettyRemotingAbstract.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void run() {
111111
while (!this.isStoped()) {
112112
try {
113113
NettyEvent event = this.eventQueue.poll(3000, TimeUnit.MILLISECONDS);
114-
if (event != null) {
114+
if (event != null && listener != null) {
115115
switch (event.getType()) {
116116
case IDLE:
117117
listener.onChannelIdle(event.getRemoteAddr(), event.getChannel());

rocketmq-remoting/src/main/java/com/alibaba/rocketmq/remoting/netty/NettySystemConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ public class NettySystemConfig {
2020
public static final String SystemPropertyClientAsyncSemaphoreValue = //
2121
"com.rocketmq.remoting.clientAsyncSemaphoreValue";
2222
public static int ClientAsyncSemaphoreValue = //
23-
Integer.parseInt(System.getProperty(SystemPropertyClientAsyncSemaphoreValue, "128"));
23+
Integer.parseInt(System.getProperty(SystemPropertyClientAsyncSemaphoreValue, "2048"));
2424

2525
public static final String SystemPropertyClientOnewaySemaphoreValue = //
2626
"com.rocketmq.remoting.clientOnewaySemaphoreValue";
2727
public static int ClientOnewaySemaphoreValue = //
28-
Integer.parseInt(System.getProperty(SystemPropertyClientOnewaySemaphoreValue, "256"));
28+
Integer.parseInt(System.getProperty(SystemPropertyClientOnewaySemaphoreValue, "2048"));
2929
}

0 commit comments

Comments
 (0)