Skip to content

Commit

Permalink
close akkadotnet#3879 - disable buffer pooling in DotNetty transport
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed Feb 25, 2020
1 parent 618a39a commit 0558f1a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
5 changes: 0 additions & 5 deletions src/core/Akka.Remote/Configuration/Remote.conf
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,6 @@ akka {
# i.e. how long a connect may take until it is timed out
connection-timeout = 15 s

# Toggles buffer pooling on and off inside DotNetty.
# Only intended to be a work-around for users who are still running on DotNetty v0.4.6-v0.4.7
# for the following bug: https://github.com/akkadotnet/akka.net/issues/3370
enable-pooling = true

# PERFORMANCE TUNING
#
# The batching feature of DotNetty is designed to help batch together logical writes into a smaller
Expand Down
4 changes: 2 additions & 2 deletions src/core/Akka.Remote/Transport/DotNetty/DotNettyTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ protected Bootstrap ClientFactory(Address remoteAddress)
.Option(ChannelOption.TcpNodelay, Settings.TcpNoDelay)
.Option(ChannelOption.ConnectTimeout, Settings.ConnectTimeout)
.Option(ChannelOption.AutoRead, false)
.Option(ChannelOption.Allocator, Settings.EnableBufferPooling ? (IByteBufferAllocator)PooledByteBufferAllocator.Default : UnpooledByteBufferAllocator.Default)
.Option(ChannelOption.Allocator, UnpooledByteBufferAllocator.Default)
.ChannelFactory(() => Settings.EnforceIpFamily
? new TcpSocketChannel(addressFamily)
: new TcpSocketChannel())
Expand Down Expand Up @@ -386,7 +386,7 @@ private ServerBootstrap ServerFactory()
.Option(ChannelOption.TcpNodelay, Settings.TcpNoDelay)
.Option(ChannelOption.AutoRead, false)
.Option(ChannelOption.SoBacklog, Settings.Backlog)
.Option(ChannelOption.Allocator, Settings.EnableBufferPooling ? (IByteBufferAllocator)PooledByteBufferAllocator.Default : UnpooledByteBufferAllocator.Default)
.Option(ChannelOption.Allocator, UnpooledByteBufferAllocator.Default)
.ChannelFactory(() => Settings.EnforceIpFamily
? new TcpServerSocketChannel(addressFamily)
: new TcpServerSocketChannel())
Expand Down
2 changes: 0 additions & 2 deletions src/core/Akka.Remote/Transport/DotNetty/TcpTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ public override bool Write(ByteString payload)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static IByteBuffer ToByteBuffer(IChannel channel, ByteString payload)
{
//TODO: optimize DotNetty byte buffer usage
// (maybe custom IByteBuffer working directly on ByteString?)
var buffer = Unpooled.WrappedBuffer(payload.ToByteArray());
return buffer;
}
Expand Down

0 comments on commit 0558f1a

Please sign in to comment.