You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Jose Alberto Fernandez <ja...@cellectivity.com> on 2005/10/06 15:32:03 UTC

[MINA] Some Questions

Hi guys,

 

We are evaluating the use of MINA as the server kernel for one of our
projects.

 

I have been roaming around on the site and the code and have some
questions.

 

1)       Are there any stress test numbers or profiling that has been
done? I have not come across anything yet.

2)       I have been looking at the way things are done in MINA and in
particular at the ServiceRegistry API and it seem that any filters that
one sets up apply to all ports and protocols. So I could not have SSL
setup on one port and no-SSL in another. Is this the case? One would
think that one should be able to set-up such filtering in a Service by
Service basis (i.e., http vs. https).

3)       While trying to understand (2) I noticed the following code in
SimpleServiceRegistry:

 

 
219
<http://directory.apache.org/subprojects/network/xref/org/apache/mina/re
gistry/SimpleServiceRegistry.html#219#219>      private void
startThreadPools()
220
<http://directory.apache.org/subprojects/network/xref/org/apache/mina/re
gistry/SimpleServiceRegistry.html#220#220>      {
221
<http://directory.apache.org/subprojects/network/xref/org/apache/mina/re
gistry/SimpleServiceRegistry.html#221#221>          if(
!services.isEmpty() )
222
<http://directory.apache.org/subprojects/network/xref/org/apache/mina/re
gistry/SimpleServiceRegistry.html#222#222>              return;
223
<http://directory.apache.org/subprojects/network/xref/org/apache/mina/re
gistry/SimpleServiceRegistry.html#223#223>  
224
<http://directory.apache.org/subprojects/network/xref/org/apache/mina/re
gistry/SimpleServiceRegistry.html#224#224>
ioThreadPoolFilter.start();
225
<http://directory.apache.org/subprojects/network/xref/org/apache/mina/re
gistry/SimpleServiceRegistry.html#225#225>
protocolThreadPoolFilter.start();
226
<http://directory.apache.org/subprojects/network/xref/org/apache/mina/re
gistry/SimpleServiceRegistry.html#226#226>      }

227
<http://directory.apache.org/subprojects/network/xref/org/apache/mina/re
gistry/SimpleServiceRegistry.html#227#227> 

 

Is this correct? You only start the thread pools when there are no
services? Looks odd.

 

Thanks in advance,

 

Jose Alberto Fernandez Redonet

 


Re: [MINA] Some Questions

Posted by Trustin Lee <tr...@gmail.com>.
Hi Maarten,

2005/10/7, Maarten Bosteels <m....@pandora.be>:
>
> I also happened to browse this code yesterday, and I was also wondering
> whether this was correct.
> I figured the examples wouldn't work if it wasn't.
> But maybe some comment in the code might clarify it for anyone quickly
> reading through the code.
> Just a very minor enhancement.


I added some comments as you advised. Thanks!

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Re: [MINA] Some Questions

Posted by Maarten Bosteels <m....@pandora.be>.
Trustin Lee wrote:

>     3)       While trying to understand (2) I noticed the following
>     code in SimpleServiceRegistry:
>
>219     private void startThreadPools()
>
>220     {
>
>221         if( !services.isEmpty() )
>
>222             return;
>
>223 
>
>224         ioThreadPoolFilter.start();
>
>225         protocolThreadPoolFilter.start();
>
>226     }
>
>     Is this correct? You only start the thread pools when there are no
>     services? Looks odd.
>
> It is correct because startThreadPools() is invoked whenever bind() is 
> called().  Thread pools should be started only when it is the first bind.


I also happened to browse this code yesterday, and I was also wondering 
whether this was correct.
I figured the examples wouldn't work if it wasn't.
But maybe some comment in the code might clarify it for anyone quickly 
reading through the code.
Just a very minor enhancement.

Maarten

Re: [MINA] Some Questions

Posted by Trustin Lee <tr...@gmail.com>.
Hi Jose,

2005/10/6, Jose Alberto Fernandez <ja...@cellectivity.com>:
>
> We are evaluating the use of MINA as the server kernel for one of our
> projects.
>
Great. Any questions and requests for support is OK.

> I have been roaming around on the site and the code and have some
> questions.
>
>  1) Are there any stress test numbers or profiling that has been done? I
> have not come across anything yet.
>
Not much yet. Possibly you can provide some benchmark tests for us. It is
known than MINA can handle more than 30k clients at once AFAIK.

> 2) I have been looking at the way things are done in MINA and in
> particular at the ServiceRegistry API and it seem that any filters that one
> sets up apply to all ports and protocols. So I could not have SSL setup on
> one port and no-SSL in another. Is this the case? One would think that one
> should be able to set-up such filtering in a Service by Service basis (i.e.,
> http vs. https).
>
You can add filters to each session. There is a method called
'getFilterChain()' in IoSession and ProtocolSession.

> 3) While trying to understand (2) I noticed the following code in
> SimpleServiceRegistry:
>
> 219 <http://directory.apache.org/subprojects/network/xref/org/apache/mina/registry/SimpleServiceRegistry.html#219%23219>     *private* *void* startThreadPools()
>
> 220 <http://directory.apache.org/subprojects/network/xref/org/apache/mina/registry/SimpleServiceRegistry.html#220%23220>     {
>
> 221 <http://directory.apache.org/subprojects/network/xref/org/apache/mina/registry/SimpleServiceRegistry.html#221%23221>         *if*( !services.isEmpty() )
>
> 222 <http://directory.apache.org/subprojects/network/xref/org/apache/mina/registry/SimpleServiceRegistry.html#222%23222>             *return*;
>
> 223 <http://directory.apache.org/subprojects/network/xref/org/apache/mina/registry/SimpleServiceRegistry.html#223%23223>
>
> 224 <http://directory.apache.org/subprojects/network/xref/org/apache/mina/registry/SimpleServiceRegistry.html#224%23224>         ioThreadPoolFilter.start();
>
> 225 <http://directory.apache.org/subprojects/network/xref/org/apache/mina/registry/SimpleServiceRegistry.html#225%23225>         protocolThreadPoolFilter.start();
>
> 226 <http://directory.apache.org/subprojects/network/xref/org/apache/mina/registry/SimpleServiceRegistry.html#226%23226>     }
>
> 227<http://directory.apache.org/subprojects/network/xref/org/apache/mina/registry/SimpleServiceRegistry.html#227%23227>
>
>  Is this correct? You only start the thread pools when there are no
> services? Looks odd.
>

It is correct because startThreadPools() is invoked whenever bind() is
called(). Thread pools should be started only when it is the first bind.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/