mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederic Soulier <frede...@wallaby.uklinux.net>
Subject Re: Thread pools setup and behavior with MINA 1.0.0
Date Fri, 27 Oct 2006 13:52:52 GMT
Thx Frederic.

Switching the socket acceptor to newCachedThreadPool works as expected
now.

Now by default MINA uses 1 socketIoProcessor and my guess is that this
number is highly dependent on the number of CPUs in the server.
In my case with 4 CPUs I suspect I could go with 4 socketIoProcessors.

What would be the "optimised" number of socketIoProcessors?

Thx.

On Fri, 2006-10-27 at 15:05 +0200, Frédéric Brégier wrote:
> If you specify newFixedThreadPool, then you have a pool of thread
> limited to the number you specified (here 16).
> Perhaps MINA takes one thread for itself, so you have at least
> 15 threads (maybe 16) that are available for clients,
> specifically for the first thread spool (socketAcceptor).
> 
> So what you want is probably to use newCachedThreadPool
> which enables the system to create as many threads it needs
> but caching these threads in spool so that threads becomes faster ready
> to run another task.
> 
> By default, Mina does not set a 16 thread pool for socketAcceptor.
> In fact, the first level (socketAcceptor) is something
> similar to newCachedThreadPool as it creates new thread
> each time it is needed. The main difference here with
> newCachedThreadPool is that dead thread will never
> be used again.
> So setting newCachedThreadPool should be better
> than native way in Mina for socketAcceptor.
> 
> In the filter Chain, there is by default a 16 threads pool
> in Mina, as a FixedThreadPool should do.
> You should be able to choose either Fixed or Cached here
> if you want to set up your own thread pool.

-- 
Frederic Soulier <frederic@wallaby.uklinux.net>
OpenPGP key available on http://www.keyserver.net
1024D/BA6700ED   49A6 8E8E 4230 8D41 1ADE  B649 3203 1DD2 BA67 00ED


Mime
View raw message