fixed issue #726, 去掉socket receiveBuffer/sendBuffer的设置,影响网络吞吐量
This commit is contained in:
+1
-1
@@ -54,7 +54,7 @@ public class BinlogDumpCommandPacket extends CommandPacket {
|
||||
// 1. write 4 bytes bin-log position to start at
|
||||
ByteHelper.writeUnsignedIntLittleEndian(binlogPosition, out);
|
||||
// 2. write 2 bytes bin-log flags
|
||||
int binlog_flags = 0;
|
||||
int binlog_flags = BINLOG_DUMP_NON_BLOCK;
|
||||
binlog_flags |= BINLOG_SEND_ANNOTATE_ROWS_EVENT;
|
||||
out.write(binlog_flags);
|
||||
out.write(0x00);
|
||||
|
||||
-2
@@ -11,8 +11,6 @@ public abstract class BioSocketChannelPool {
|
||||
|
||||
public static BioSocketChannel open(SocketAddress address) throws Exception {
|
||||
Socket socket = new Socket();
|
||||
socket.setReceiveBufferSize(32 * 1024);
|
||||
socket.setSendBufferSize(32 * 1024);
|
||||
socket.setSoTimeout(BioSocketChannel.SO_TIMEOUT);
|
||||
socket.setTcpNoDelay(true);
|
||||
socket.setKeepAlive(true);
|
||||
|
||||
+1
-2
@@ -37,11 +37,10 @@ public abstract class NettySocketChannelPool {
|
||||
static {
|
||||
boot.group(group)
|
||||
.channel(NioSocketChannel.class)
|
||||
.option(ChannelOption.SO_RCVBUF, 32 * 1024)
|
||||
.option(ChannelOption.SO_SNDBUF, 32 * 1024)
|
||||
.option(ChannelOption.TCP_NODELAY, true)
|
||||
// 如果是延时敏感型应用,建议关闭Nagle算法
|
||||
.option(ChannelOption.SO_KEEPALIVE, true)
|
||||
.option(ChannelOption.SO_REUSEADDR, true)
|
||||
.option(ChannelOption.RCVBUF_ALLOCATOR, AdaptiveRecvByteBufAllocator.DEFAULT)
|
||||
.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT)
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user