directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Fwd: Mina threading
Date Mon, 18 Apr 2005 15:42:48 GMT
I thought this could be helpful for users who want to know about MINA
thread pool.

---------- Forwarded message ----------
From: Trustin Lee <trustin@gmail.com>
Date: 2005. 4. 19 오전 12:41
Subject: Re: Mina threading
To: "daune.jf@daune-consult.com" <daune.jf@daune-consult.com>


Hi!  It's been long time to see you.

2005/4/18, daune.jf@daune-consult.com <daune.jf@daune-consult.com>:
> Hi Trustin,
>
> sorry to bug you using you e-mail, but I have not found a mailing list/user
> forum for the Mina project.

Our web site is out-of-date.  I update the site so it should be update
sooner or later by apache infra team.

Subscription: dev-subscribe@directory.apache.org
Archive: http://directory.apache.org/mailing-lists.html

> My first question is: do you consider Mina stable enough for switch ?

You can just retain your message and message recognizer
implementation.  So the cost to switch to MINA and vice versa should
be easy.  I think MINA is very stable.  The only one worry is the
possibility of API change.  There were several API changes although
they were all easy to follow.

> My second issue is about Mina threading model.
>
> I built my server using the Reverser sample as a basis. From code reading, I can
> see that there are the following threads:
>
> - one SocketAcceptor thread
> - one SocketIoProcessor thread
> - one IoThreadPoolFilter thread per connection
> - one ProtocolThreadPoolFilter thread per connection
>
> My understanding is that unless maximum pool size is set for IoThreadPoolFilter
> and ProtocolThreadPoolFilter, their pool can be extended without limit.
>
> Unfortunately, I don not really understand what each thread is there for.
>
> This is important for me to really understand what's behind the scene.
>
> Is there a design document that explains this ?

The size of IoThreadPoolFilter and ProtocolThreadPoolFilter is
automatically adjusted by thelselves, and therefore it is not
one-to-one relationship.  Idle connections doesn't take any threads
because their implementation is leader-followers thread pool.  It
increases the number of active thread when it is busy, and decreases
when idle.  You can set the maximum number of active threads and
maximum idle time for active threads.  It is much more flexible and it
requires less human configuration.  Sounds cool? ;)

There is a link to PDF file in JavaDoc of ThreadPoolFilters which
explains the internals of leader-followers thread pool.  So If you
want to know what's going on behind the scene, you could read it up.

> Best regards,
> and thanks for your work on Mina (still better than Netty2 !),

Thanks!  Any feature requests and questions are welcome. :)

Regards,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
Mime
View raw message