GitHub user bgutjahr opened a pull request:
https://github.com/apache/activemq-artemis/pull/468
ARTEMIS-485: Use unbounded client thread-pool by default
I changed the ActiveMQClient code to use an unbounded cached thread pool by
default, as it was the case with Artemis 1.1.0 and before.
Bounded fixed-size thread pools create and keep all configured client
threads, which can negatively impact client behavior due to additional memory
consumption. Even the recently made change to set default max size based on the
number of cores won't help on modern multi-core systems.
I also had to remove the capability to dynamically change the thread pool
max size, as this would not work if changing the size of an unbounded cached
thread pool (due to different blocking queue classes). So after changing the
max size, the caches have to cleared to get new caches created.
In addition, I fixed some API flaws (public writable fields and not
checking for injected null thread pools).
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bgutjahr/activemq-artemis thread_pools
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/activemq-artemis/pull/468.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #468
----
commit 54b553465ba49152413a3b36c482584adc102968
Author: Bernd Gutjahr <[email protected]>
Date: 2016-04-15T06:20:05Z
ARTEMIS-485 Use unbounded client thread pool by default
Set default global client thread pool size back to -1,
and adapted code to handle -1 correctly to configured an unbounded (cached)
thread pool.
In addition, I the capability to reconfigure the max pool size of existing
thread pools, because the global thread pool can either be an unbounded
cached pool, or a bounded fixed size pool. These 2 kinds of pool also
differ in the used blocking queue, and cannot be converted into each other.
commit 2a4ff199b1732ec3aabde71174138594322e5259
Author: Bernd Gutjahr <[email protected]>
Date: 2016-04-15T06:58:15Z
ARTEMIS-485 Updated related comments
Corrected code comments according to previous changed.
commit 2f20199d1929319cc2e31cfd176ca6b9453c434b
Author: Bernd Gutjahr <[email protected]>
Date: 2016-04-15T07:14:30Z
Changed public fields in ActiveMQClient to private and added getters.
Exposing fields for thread pool sized allow to modify them in undesired
ways.
I made these fields private and added corresponding getter methods.
In addition, I renamed the field 'globalThreadMaxPoolSize'
to 'globalThreadPoolSize' to be more consistent with the
'globalScheduledThreadPoolSize' field name.
I also adapted some tests to always call clearThreadPools after
the thread pool size configuration has been changed.
commit 0dc7dd20f42cd38f8868bc17696d08796ee8424c
Author: Bernd Gutjahr <[email protected]>
Date: 2016-04-15T11:54:09Z
Protect against injecting null as thread pools
ActiveMQClient.injectPools allowed null as injected thread pools.
The effect was that internal threads pools were created,
but not shutdown correctly.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---