From 57401818bcd5901539817f62778a009981c4d8ea Mon Sep 17 00:00:00 2001 From: He-Pin Date: Tue, 19 Sep 2023 20:31:29 +0800 Subject: [PATCH] =remote Make use of FlushConsolidationHandler to improve throughput. --- .../apache/pekko/remote/transport/netty/NettyTransport.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala b/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala index f52d4540e3b..0956548fdfe 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala @@ -52,6 +52,7 @@ import io.netty.channel.nio.NioEventLoopGroup import io.netty.channel.socket.SocketChannel import io.netty.channel.socket.nio.{ NioServerSocketChannel, NioSocketChannel } import io.netty.handler.codec.{ LengthFieldBasedFrameDecoder, LengthFieldPrepender } +import io.netty.handler.flush.FlushConsolidationHandler import io.netty.handler.ssl.SslHandler import io.netty.util.concurrent.GlobalEventExecutor @@ -368,6 +369,8 @@ class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedA private def newPipeline(channel: Channel): ChannelPipeline = { val pipeline = channel.pipeline() + pipeline.addFirst("FlushConsolidationHandler", + new FlushConsolidationHandler(FlushConsolidationHandler.DEFAULT_EXPLICIT_FLUSH_AFTER_FLUSHES, true)) pipeline.addLast( "FrameDecoder", new LengthFieldBasedFrameDecoder(