rocketmq警告日志:auto-read is disabled, bytes to drain before it turns writable

rocketmq的remoting.log日志一直在打印如下警告日志:

2024-06-11 10:51:16 WARN NettyServerCodecThread_1 - Channel[192.168.1.2:53662] auto-read is disabled, bytes to drain before it turns writable: 35571
2024-06-11 10:51:16 INFO NettyServerCodecThread_1 - Channel[192.168.1.2:53662] turns writable, bytes to buffer before changing channel to un-writable: 65536
2024-06-11 10:51:40 WARN NettyServerCodecThread_4 - Channel[192.168.1.2:47966] auto-read is disabled, bytes to drain before it turns writable: 61404
2024-06-11 10:51:40 WARN NettyServerCodecThread_4 - Channel[192.168.1.2:47966] auto-read is disabled, bytes to drain before it turns writable: 61404
2024-06-11 10:51:40 INFO NettyServerCodecThread_4 - Channel[192.168.1.2:47966] turns writable, bytes to buffer before changing channel to un-writable: 65536
2024-06-11 10:52:28 WARN NettyServerCodecThread_4 - Channel[192.168.1.2:47966] auto-read is disabled, bytes to drain before it turns writable: 61404
2024-06-11 10:52:28 WARN NettyServerCodecThread_4 - Channel[192.168.1.2:47966] auto-read is disabled, bytes to drain before it turns writable: 61404
2024-06-11 10:52:28 INFO NettyServerCodecThread_4 - Channel[192.168.1.2:47966] turns writable, bytes to buffer before changing channel to un-writable: 65536
2024-06-11 10:52:52 WARN NettyServerCodecThread_1 - Channel[192.168.1.2:53662] auto-read is disabled, bytes to drain before it turns writable: 0
2024-06-11 10:52:52 INFO NettyServerCodecThread_1 - Channel[192.168.1.2:53662] turns writable, bytes to buffer before changing channel to un-writable: 65536

解决办法

在配置文件加入如下配置:

# 设置TCP发送缓冲区大小
serverSocketSndBufSize=65536
# 设置TCP接收缓冲区大小
serverSocketRcvBufSize=65536
# 设置写缓冲区的高水位标记
writeBufferHighWaterMark=4194304
# 设置写缓冲区的低水位标记
writeBufferLowWaterMark=1048576

原因

日志信息显示了一些关于RocketMQ使用Netty通信框架时的通道(Channel)状态。这里的日志信息主要涉及以下几个关键点:
1、Auto-read is disabled: 当auto-read被禁用时,Netty不会自动从网络中读取数据,直到明确命令它这么做。这可能是为了控制数据流,防止内存溢出。
2、Bytes to drain before it turns writable: 这表示在通道可以再次开始写操作之前,还需要从通道中排出多少字节的数据。这是流控制的一种形式,通常用于防止发送方过快地发送数据而接收方来不及处理。
3、Turns writable, bytes to buffer before changing channel to un-writable: 当通道变为可写时,会记录可以缓冲的字节数,直到通道再次变为不可写。这表明了通道从不可写状态转换到可写状态的阈值。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值