Uploaded image for project: 'Modular Service Container'
  1. Modular Service Container
  2. MSC-144

High number of "MSC service thread" in multicore Machines

XMLWordPrintable

    • Compatibility/Configuration
    • Hide

      no workaround for me. had to get the code from github and rebuild. fix is fairly simple so I don't submit a pull.

      Show
      no workaround for me. had to get the code from github and rebuild. fix is fairly simple so I don't submit a pull.
    • 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);
               }
      

              ropalka Richard Opalka
              amin59 Amin Abbaspour (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 1 minute
                  1m
                  Remaining:
                  Remaining Estimate - 1 minute
                  1m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified