[Vortex] Thread pool in vortex

subrahmanya sum.sagar at gmail.com
Wed Feb 29 14:04:12 CET 2012


Hi

I wanted to understand thread pool mechanism in vortex.

I see that vortex creates a pool of threads for each context and the
default pool size is 5. This pool is shared across all connections created
using this context. Is that correct? Does it expand/shrink automatically?
Ideally I would not like to create 5 threads when context is created
instead it has to be created only when a new thread is required.

If the thread pool does not expand automatically then creating many
connections over the same context wouldn't be a good idea since that can
lead to performance issues. I see that pool size can be configured through
environment variable which means the value is applicable to any context
created in that process. If the pool is not expandable/shrinkable then it
may not be a good idea to allocate 5 threads per context. This could be a
burden in some scenarios when multiple contexts are created in the process.
Activities over different connections created with different contexts might
not be uniform. This means creating 5 threads (or whatever value is
configured through the environment variable) for some of the contexts may
be optimum and for some this value would be high and for some it could be
low as well. So not having a expandable/shrinkable pool would mean high
resource usage even in case of very less activity.

For me the solution seems to be to maintain a global thread pool rather
than having a thread pool per context and the global thread pool has to be
shared by different contexts. And, the thread pool has to be expanded when
there is high activity and there are no threads available and reduced when
there is less activity. Yes there should be a limit on the max number of
threads to be created in this pool. This way resource usage can be
controlled when there is no activity on the connections.

Thanks
Subrahmanya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.aspl.es/pipermail/vortex/attachments/20120229/4d3a8167/attachment.htm>


More information about the Vortex mailing list