store client specific information

Trustin Lee tlee at redhat.com
Fri Feb 13 08:41:22 EST 2009


FYI, the latest revision in the SVN repository checks the number of
active thread pools and prints some advisory in DEBUG log level if
it's above normal.  For instance, your server will print the following
message:

  "There are too many active MemoryAwareThreadPoolExecutor instances
(64) - you should share the small number of instances to avoid
excessive resource consumption."

I logged this message in the DEBUG log level because it might be a
false positive.  64 active thread pools don't make sense in most
cases, but who knows?  It can be an intended move if one is using a
1024-core machine. :)

— Trustin Lee, http://gleamynode.net/

On Fri, Feb 13, 2009 at 10:00 PM, Trustin Lee <tlee at redhat.com> wrote:
> Pete,
>
> A single OrderedMemoryAwareThreadPoolExecutor instance should be
> shared by more than one pipeline.  If
> ChannelPipelineFactory.getPipeline() creates a new
> OrederedMemoryAwareThreadPoolExecutor, it means each connection will
> have its own thread pool and it does not make sense.  You should at
> least do the following:
>
>  public class MyPipelineFactory implements ChannelPipelineFactory {
>    private final ExecutionHandler executionHandler = new
> ExecutionHandler(new OrderedMemoryAwareThreadPool(...));
>
>    public ChannelPipeline getPipeline() {
>      ChannelPipeline p = Channels.pipeline();
>      p.addLast("execution", executionHandler);  // Use one instance
> again and again
>      ...
>      return p;
>    }
>  }
>
> HTH,
>
> — Trustin Lee, http://gleamynode.net/
>
>
>
> On Fri, Feb 13, 2009 at 4:58 AM, miarkus <miarkus at tlen.pl> wrote:
>>
>> Hello again,
>>
>> I figured out that removing OrderedMemoryAwareThreadPoolExecutor from
>> PipelineFactory solves the problem.
>>
>> Before:
>> 100 connections -> 1000 threads running
>>
>> After:
>> 2000 connections -> 6 threads running
>>
>> Question:
>>
>> I need to incorporate ExecutionHandler into PipelineFactory because I'm
>> querying mysql with each client connection. What are the possibilities in
>> this situation?
>> --
>> View this message in context: http://n2.nabble.com/store-client-specific-information-tp2176934p2317204.html
>> Sent from the Netty User Group mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> netty-users mailing list
>> netty-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/netty-users
>>
>




More information about the netty-users mailing list