You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Greg Duffy <gd...@gmail.com> on 2006/02/16 00:27:17 UTC

[mina] Minimum thread pool size, IoFilterChain initialization

Hi!

I'm using the 0.9.2-SNAPSHOT of MINA.

Would it be possible/prudent to allow a minimum thread pool size in
the TheadPoolFilter? After periods of inactivity I notice a small bit
of latency when new threads are being created, and it'd be nice to
have some control over it. My "clients" (actually automated processes)
are impatient and tend to retransmit if I don't send something back
quickly enough (and I need to do it in a separate connection, which
means more latency if I'm using different ThreadPoolFilter(s) for
that). For my purposes, retransmits are not fatal, but it would be
nice to avoid them nonetheless.

Also, I was wondering where the best place is to initialize the
IoFilterChain. Right now I'm doing it on the creation or opening of a
session, but the set of filters I use is static. Is there a better or
more performant place to put that? I've got two instances I'm
wondering about: one using a ServiceRegistry and one initializing a
connector directly (for client communication).

On a side note, I'm just starting to work with MINA, so hello and
thanks for a cool project! Feel free to set me straight if I'm missing
a big concept in anything above.

-Greg Duffy

Re: [mina] Minimum thread pool size, IoFilterChain initialization

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

On 3/1/06, Greg Duffy <gd...@gmail.com> wrote:
>
> Trustin,
>
> Thanks for creating the issue.
>
> On the second part, I can't get the new configuration method to work
> for a DatagramAcceptor. I looked into your code a bit, and I could not
> find the place(s) where the filter chain builder is extracted from the
> configuration and invoked on the session.
>
> I did find those places in the DatagramConnector, which seems to work
> well with the new configuration method.
>
> Is that part missing in the acceptor code, or am I off on something?


I don't see any problem in DatagramAcceptor (strictly speaking, it's
DatagramAcceptorDelegate).  Could you give me an example that doesn't work
for you?

Sorry for the late response. :(

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: [mina] Minimum thread pool size, IoFilterChain initialization

Posted by Greg Duffy <gd...@gmail.com>.
Trustin,

Thanks for creating the issue.

On the second part, I can't get the new configuration method to work
for a DatagramAcceptor. I looked into your code a bit, and I could not
find the place(s) where the filter chain builder is extracted from the
configuration and invoked on the session.

I did find those places in the DatagramConnector, which seems to work
well with the new configuration method.

Is that part missing in the acceptor code, or am I off on something?

Thanks,
Greg

On 2/25/06, Trustin Lee <tr...@gmail.com> wrote:
> On 2/16/06, Greg Duffy <gd...@gmail.com> wrote:
> > Would it be possible/prudent to allow a minimum thread pool size in
> > the TheadPoolFilter? After periods of inactivity I notice a small bit
> > of latency when new threads are being created, and it'd be nice to
> > have some control over it. My "clients" (actually automated processes)
> > are impatient and tend to retransmit if I don't send something back
> > quickly enough (and I need to do it in a separate connection, which
> > means more latency if I'm using different ThreadPoolFilter(s) for
> > that). For my purposes, retransmits are not fatal, but it would be
> > nice to avoid them nonetheless.
>
> You can track this issue from now on here:
>
> http://issues.apache.org/jira/browse/DIRMINA-178
>
> > Also, I was wondering where the best place is to initialize the
> > IoFilterChain. Right now I'm doing it on the creation or opening of a
> > session, but the set of filters I use is static. Is there a better or
> > more performant place to put that? I've got two instances I'm
> > wondering about: one using a ServiceRegistry and one initializing a
> > connector directly (for client communication).
>
> Since 0.9.2, the configuration API has been improved. Here's the example:
>
> SocketAcceptorConfig cfg = new SocketAcceptorConfig();
> cfg.getFilterChain().addLast( "...", ... );
> ...
> cfg.setReuseAddress( true );
>
> acceptor.bind( address, myHandler, cfg );
>
> WDYT?
>
> > On a side note, I'm just starting to work with MINA, so hello and
> > thanks for a cool project! Feel free to set me straight if I'm missing
> > a big concept in anything above.
>
> Thank you for your high-quality feedback.  The Apache MINA team will always
> respect your criticism.  Please feel free to keep feeding us back. :)
>
> HTH,
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP key fingerprints:
> * E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
> * B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: [mina] Minimum thread pool size, IoFilterChain initialization

Posted by Trustin Lee <tr...@gmail.com>.
On 2/16/06, Greg Duffy <gd...@gmail.com> wrote:
>
> Would it be possible/prudent to allow a minimum thread pool size in
> the TheadPoolFilter? After periods of inactivity I notice a small bit
> of latency when new threads are being created, and it'd be nice to
> have some control over it. My "clients" (actually automated processes)
> are impatient and tend to retransmit if I don't send something back
> quickly enough (and I need to do it in a separate connection, which
> means more latency if I'm using different ThreadPoolFilter(s) for
> that). For my purposes, retransmits are not fatal, but it would be
> nice to avoid them nonetheless.


You can track this issue from now on here:

http://issues.apache.org/jira/browse/DIRMINA-178

Also, I was wondering where the best place is to initialize the
> IoFilterChain. Right now I'm doing it on the creation or opening of a
> session, but the set of filters I use is static. Is there a better or
> more performant place to put that? I've got two instances I'm
> wondering about: one using a ServiceRegistry and one initializing a
> connector directly (for client communication).


Since 0.9.2, the configuration API has been improved. Here's the example:

SocketAcceptorConfig cfg = new SocketAcceptorConfig();
cfg.getFilterChain().addLast( "...", ... );
...
cfg.setReuseAddress( true );

acceptor.bind( address, myHandler, cfg );

WDYT?

On a side note, I'm just starting to work with MINA, so hello and
> thanks for a cool project! Feel free to set me straight if I'm missing
> a big concept in anything above.


Thank you for your high-quality feedback.  The Apache MINA team will always
respect your criticism.  Please feel free to keep feeding us back. :)

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: [mina] Minimum thread pool size, IoFilterChain initialization

Posted by Trustin Lee <tr...@gmail.com>.
On 2/16/06, Greg Duffy <gd...@gmail.com> wrote:
>
> Would it be possible/prudent to allow a minimum thread pool size in
> the TheadPoolFilter? After periods of inactivity I notice a small bit
> of latency when new threads are being created, and it'd be nice to
> have some control over it. My "clients" (actually automated processes)
> are impatient and tend to retransmit if I don't send something back
> quickly enough (and I need to do it in a separate connection, which
> means more latency if I'm using different ThreadPoolFilter(s) for
> that). For my purposes, retransmits are not fatal, but it would be
> nice to avoid them nonetheless.


You can track this issue from now on here:

http://issues.apache.org/jira/browse/DIRMINA-178

Also, I was wondering where the best place is to initialize the
> IoFilterChain. Right now I'm doing it on the creation or opening of a
> session, but the set of filters I use is static. Is there a better or
> more performant place to put that? I've got two instances I'm
> wondering about: one using a ServiceRegistry and one initializing a
> connector directly (for client communication).


Since 0.9.2, the configuration API has been improved. Here's the example:

SocketAcceptorConfig cfg = new SocketAcceptorConfig();
cfg.getFilterChain().addLast( "...", ... );
...
cfg.setReuseAddress( true );

acceptor.bind( address, myHandler, cfg );

WDYT?

On a side note, I'm just starting to work with MINA, so hello and
> thanks for a cool project! Feel free to set me straight if I'm missing
> a big concept in anything above.


Thank you for your high-quality feedback.  The Apache MINA team will always
respect your criticism.  Please feel free to keep feeding us back. :)

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6