title: latency in netty due to passing requests from boss thread to worker thread?
body: <p>I have some questions about Netty (Server Side), TCP/IP applications; </p>
  
  <p>I am wondering if there can be latency because of netty (due to missing configuration etc.) while passing the request from boss thread to worker thread ?</p>
  
  <p>I am using :</p>
  
  <pre><code>new OrderedMemoryAwareThreadPoolExecutor(350, 0, 0, 1, TimeUnit.SECONDS);
  </code></pre>
  
  <p>Actually, I set max thread count <code>350</code> as I am not sure about the optimal number. I log simultaneous working thread count every minute and it seems that average is too low (barely exceeds <code>10</code>). So I will decrease this number as it is not required.</p>
  
  <p>Is there any other parameters,important points that I should be aware of for to get best performance ?</p>
  
  <p><code>bootstrap.setOption("tcpNoDelay", true);</code> -  Is there any disadvantage of setting this parameter?  Considering that delivery time is very important.</p>
  
  <p>Thread Pool Executer:</p>
  
  <pre><code>OrderedMemoryAwareThreadPoolExecutor executor = new OrderedMemoryAwareThreadPoolExecutor(48, 0, 0, 1, TimeUnit.SECONDS);
  </code></pre>
  
  <p>Here is my pipeline factory:</p>
  
  <pre><code>    ChannelPipeline pipeline = pipeline();
      pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(GProperties.getIntProperty("decoder.maxFrameLength", 8000 * 1024), Delimiters.nulDelimiter()));
      pipeline.addLast("stringDecoder", new StringDecoder( CharsetUtil.UTF_8 ));      
      pipeline.addLast("frameEncoder", new NullTermMessageEncoder());
      pipeline.addLast("stringEncoder", new JSONEncoder( CharsetUtil.UTF_8 ));
          pipeline.addLast("timeout", new IdleStateHandler(idleTimer, 42 , 0, 0));
      pipeline.addLast("executor", new ExecutionHandler(executor));
      pipeline.addLast("handler", new GServerHandler());
  </code></pre>
  
  <p>and the ServerBootstrap:</p>
  
  <pre><code>gServerBootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));
          gServerBootstrap.setPipelineFactory(new GServerPipelineFactory());
                  gServerBootstrap.setOption("backlog", 8129);
                  gServerBootstrap.setOption("child.tcpNoDelay", true);
          gServerBootstrap.bind(new InetSocketAddress(GProperties.getIntProperty("server.port", 7679)));
  </code></pre>
  
  <p>What can you suggest for this configuration ?</p>