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
Showing
1 changed file
with
5 additions
and
3 deletions
... | @@ -248,8 +248,10 @@ public class NettyMessagingManager implements MessagingService { | ... | @@ -248,8 +248,10 @@ public class NettyMessagingManager implements MessagingService { |
248 | connection = channels.borrowObject(ep); | 248 | connection = channels.borrowObject(ep); |
249 | connection.send(message, future); | 249 | connection.send(message, future); |
250 | } finally { | 250 | } finally { |
251 | + if (connection != null) { | ||
251 | channels.returnObject(ep, connection); | 252 | channels.returnObject(ep, connection); |
252 | } | 253 | } |
254 | + } | ||
253 | } catch (Exception e) { | 255 | } catch (Exception e) { |
254 | future.completeExceptionally(e); | 256 | future.completeExceptionally(e); |
255 | } | 257 | } |
... | @@ -322,11 +324,11 @@ public class NettyMessagingManager implements MessagingService { | ... | @@ -322,11 +324,11 @@ public class NettyMessagingManager implements MessagingService { |
322 | 324 | ||
323 | private void startAcceptingConnections() throws InterruptedException { | 325 | private void startAcceptingConnections() throws InterruptedException { |
324 | ServerBootstrap b = new ServerBootstrap(); | 326 | ServerBootstrap b = new ServerBootstrap(); |
325 | - b.option(ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK, 32 * 1024); | 327 | + b.childOption(ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK, 32 * 1024); |
326 | - b.option(ChannelOption.WRITE_BUFFER_LOW_WATER_MARK, 8 * 1024); | 328 | + b.childOption(ChannelOption.WRITE_BUFFER_LOW_WATER_MARK, 8 * 1024); |
327 | b.option(ChannelOption.SO_RCVBUF, 1048576); | 329 | b.option(ChannelOption.SO_RCVBUF, 1048576); |
328 | b.option(ChannelOption.TCP_NODELAY, true); | 330 | b.option(ChannelOption.TCP_NODELAY, true); |
329 | - b.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT); | 331 | + b.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT); |
330 | b.group(serverGroup, clientGroup); | 332 | b.group(serverGroup, clientGroup); |
331 | b.channel(serverChannelClass); | 333 | b.channel(serverChannelClass); |
332 | if (enableNettyTls) { | 334 | if (enableNettyTls) { | ... | ... |
-
Please register or login to post a comment