title: Netty server response time inconsistent
body: <p>I created a netty tcp client and server. I calculate the total response time in client. When i do a load test i see that every 8th request takes long time. What could be the reason? Any pointers on improving the performance.</p>
  
  <pre><code>Connecting to localhost:9065
  PROCESSING TIME [32.508 ms]
  PROCESSING TIME [1.952 ms]
  PROCESSING TIME [2.157 ms]
  PROCESSING TIME [2.818 ms]
  PROCESSING TIME [1.788 ms]
  PROCESSING TIME [368.311 ms]
  PROCESSING TIME [3.107 ms]
  PROCESSING TIME [1.856 ms]
  PROCESSING TIME [1.973 ms]
  PROCESSING TIME [2.14 ms]
  PROCESSING TIME [2.022 ms]
  PROCESSING TIME [1.781 ms]
  PROCESSING TIME [1.967 ms]
  PROCESSING TIME [411.338 ms]
  PROCESSING TIME [3.252 ms]
  PROCESSING TIME [1.769 ms]
  PROCESSING TIME [1.746 ms]
  PROCESSING TIME [4.04 ms]
  PROCESSING TIME [1.758 ms]
  PROCESSING TIME [1.81 ms]
  PROCESSING TIME [1.817 ms]
  PROCESSING TIME [1.686 ms]
  PROCESSING TIME [317.336 ms]
  PROCESSING TIME [3.084 ms]
  PROCESSING TIME [3.624 ms]
  PROCESSING TIME [3.147 ms]
  PROCESSING TIME [1.95 ms]
  PROCESSING TIME [2.16 ms]
  PROCESSING TIME [1.987 ms]
  PROCESSING TIME [1.9 ms]
  PROCESSING TIME [335.572 ms]
  PROCESSING TIME [1.835 ms]
  PROCESSING TIME [1.707 ms]
  PROCESSING TIME [1.896 ms]
  PROCESSING TIME [3.084 ms]
  </code></pre>
  
  <p>My client code is using netty 5.0.0.Alpha2 and my server is using netty 4.0.30.Final,</p>
  
  <p>My client code is same as,</p>
  
  <p><a href="https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/echo/EchoClient.java" rel="nofollow">https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/echo/EchoClient.java</a>
  <a href="https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/echo/EchoClientHandler.java" rel="nofollow">https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/echo/EchoClientHandler.java</a></p>
  
  <p>My server code is,</p>
  
  <pre><code>    final EventLoopGroup parentGroup = new NioEventLoopGroup(5);
      final EventLoopGroup childGroup = new NioEventLoopGroup();
      try
      {
          final ServerBootstrap b = new ServerBootstrap();
          b.group(parentGroup, childGroup).channel(NioServerSocketChannel.class).option(ChannelOption.SO_BACKLOG, 100).handler(new LoggingHandler(LogLevel.INFO))
                  .childHandler(new ChannelInitializer&lt;SocketChannel&gt;()
                  {
                      @Override
                      public void initChannel(final SocketChannel ch) throws Exception
                      {
                          final ChannelPipeline p = ch.pipeline();
                          if (sslCtx != null)
                          {
                              p.addLast(sslCtx.newHandler(ch.alloc()));
                          }
                          NettyServer.this.framer = (Framer) Class.forName(NettyServer.this.manifest.getFramingConfig()).newInstance();
                          NettyServer.this.headerClass = Class.forName(NettyServer.this.manifest.getHeaderConfig());
  
                          final NettyServerHandler nettyServerHandler = new NettyServerHandler(NettyServer.this.moduleName, NettyServer.this.framer, NettyServer.this.headerClass,
                                  NettyServer.this.requestProcessor.clone());
                          p.addLast(nettyServerHandler);
                      }
                  });
  
          // Start the server.
          final ChannelFuture f = b.bind(this.port).sync();
  
          // Wait until the server socket is closed.
          f.channel().closeFuture().sync();
      }
      finally
      {
          // Shut down all event loops to terminate all threads.
          parentGroup.shutdownGracefully();
          childGroup.shutdownGracefully();
      }
  </code></pre>