Yuta HIGUCHI
Committed by Gerrit Code Review

Revisiting netty configurations

- Revisiting netty configuration based on:
-- http://normanmaurer.me/presentations/2014-facebook-eng-netty/slides.html#11.0
-- http://normanmaurer.me/presentations/2014-facebook-eng-netty/slides.html#14.0

Change-Id: I6fe5586908ce2b7c87fd00c8f9da6cca3d907d10
......@@ -248,7 +248,9 @@ public class NettyMessagingManager implements MessagingService {
connection = channels.borrowObject(ep);
connection.send(message, future);
} finally {
channels.returnObject(ep, connection);
if (connection != null) {
channels.returnObject(ep, connection);
}
}
} catch (Exception e) {
future.completeExceptionally(e);
......@@ -322,11 +324,11 @@ public class NettyMessagingManager implements MessagingService {
private void startAcceptingConnections() throws InterruptedException {
ServerBootstrap b = new ServerBootstrap();
b.option(ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK, 32 * 1024);
b.option(ChannelOption.WRITE_BUFFER_LOW_WATER_MARK, 8 * 1024);
b.childOption(ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK, 32 * 1024);
b.childOption(ChannelOption.WRITE_BUFFER_LOW_WATER_MARK, 8 * 1024);
b.option(ChannelOption.SO_RCVBUF, 1048576);
b.option(ChannelOption.TCP_NODELAY, true);
b.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
b.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
b.group(serverGroup, clientGroup);
b.channel(serverChannelClass);
if (enableNettyTls) {
......