-
Bug
-
Resolution: Done
-
Minor
-
1.0.4.GA, 1.1.5.Final, 1.2.1.Final
-
None
-
None
-
Compatibility/Configuration
-
-
Low
The behaviour of setting initial thread count to available.core*2 is not suitable for multicore processors such as Sparc T3.
I suggest putting a max limit of 8 to the MSC threads. To fix this, two lines need to be modified in:
diff --git a/src/main/java/org/jboss/msc/service/ServiceContainer.java b/src/main/java/org/jboss/msc/service/ServiceContainer.java index a52f39d..ccacab6 100644 --- a/src/main/java/org/jboss/msc/service/ServiceContainer.java +++ b/src/main/java/org/jboss/msc/service/ServiceContainer.java @@ -104,7 +104,7 @@ public interface ServiceContainer extends ServiceTarget, ServiceRegistry { */ public static ServiceContainer create() { int cpuCount = Runtime.getRuntime().availableProcessors(); - int coreSize = Math.max(cpuCount << 1, 2); + int coreSize = Math.min(Math.max(cpuCount << 1, 2), 8); return new ServiceContainerImpl(null, coreSize, 30L, TimeUnit.SECONDS); } @@ -116,7 +116,7 @@ public interface ServiceContainer extends ServiceTarget, ServiceRegistry { */ public static ServiceContainer create(String name) { int cpuCount = Runtime.getRuntime().availableProcessors(); - int coreSize = Math.max(cpuCount << 1, 2); + int coreSize = Math.min(Math.max(cpuCount << 1, 2), 8); return new ServiceContainerImpl(name, coreSize, 30L, TimeUnit.SECONDS); }