Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable buffer pooling in DotNetty transport #4252

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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