[
https://issues.jboss.org/browse/AS7-1448?page=com.atlassian.jira.plugin.s...
]
David Lloyd updated AS7-1448:
-----------------------------
Description:
An problem I ran into with using AS7 in a constrained environment that limited the number
of processes/threads a user could create was the number of threads being created for the
bootstrap service container. It would be useful if the ServiceContainer.ContainerExecutor
thread pool max threads was externalized. The higher the core count the more threads are
wasted if the purpose is to have as many AS7 instances running as possible as is the case
with the openshift express environment.
One simple approach would be to externalize this via a system property that could be added
to the ServerEnvironment ala:
{noformat}
diff --git a/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
b/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
index 60c78e7..3d93c5b 100644
--- a/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
+++ b/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
@@ -23,6 +23,7 @@
package org.jboss.as.server;
import java.util.List;
+import java.util.concurrent.TimeUnit;
import org.jboss.as.controller.persistence.ConfigurationPersister;
import org.jboss.modules.Module;
@@ -46,7 +47,14 @@ import org.jboss.threads.JBossExecutors;
* @author <a href="mailto:david.lloyd@redhat.com">David M.
Lloyd</a>
*/
final class BootstrapImpl implements Bootstrap {
- private final ServiceContainer container =
ServiceContainer.Factory.create("jboss-as");
+ private static int MAX_THREADS = 2;
+ static {
+ String maxThreads =
SecurityActions.getSystemProperty("org.jboss.server.bootstrap.maxThreads");
+ if(maxThreads != null) {
+ MAX_THREADS = Integer.decode(maxThreads);
+ }
+ }
+ private final ServiceContainer container =
ServiceContainer.Factory.create("jboss-as", MAX_THREADS, 30, TimeUnit.SECONDS);
{noformat}
was:
An problem I ran into with using AS7 in a constrained environment that limited the number
of processes/threads a user could create was the number of threads being created for the
bootstrap service container. It would be useful if the ServiceContainer.ContainerExecutor
thread pool max threads was externalized. The higher the core count the more threads are
wasted if the purpose is to have as many AS7 instances running as possible as is the case
with the openshift express environment.
One simple approach would be to externalize this via a system property that could be added
to the ServerEnvironment ala:
diff --git a/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
b/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
index 60c78e7..3d93c5b 100644
--- a/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
+++ b/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
@@ -23,6 +23,7 @@
package org.jboss.as.server;
import java.util.List;
+import java.util.concurrent.TimeUnit;
import org.jboss.as.controller.persistence.ConfigurationPersister;
import org.jboss.modules.Module;
@@ -46,7 +47,14 @@ import org.jboss.threads.JBossExecutors;
* @author <a href="mailto:david.lloyd@redhat.com">David M.
Lloyd</a>
*/
final class BootstrapImpl implements Bootstrap {
- private final ServiceContainer container =
ServiceContainer.Factory.create("jboss-as");
+ private static int MAX_THREADS = 2;
+ static {
+ String maxThreads =
SecurityActions.getSystemProperty("org.jboss.server.bootstrap.maxThreads");
+ if(maxThreads != null) {
+ MAX_THREADS = Integer.decode(maxThreads);
+ }
+ }
+ private final ServiceContainer container =
ServiceContainer.Factory.create("jboss-as", MAX_THREADS, 30, TimeUnit.SECONDS);
Edited for formatting.
Allow setting of the bootstrap ServiceContainer thread pool size
----------------------------------------------------------------
Key: AS7-1448
URL:
https://issues.jboss.org/browse/AS7-1448
Project: Application Server 7
Issue Type: Feature Request
Components: Server
Affects Versions: 7.0.0.Final
Reporter: Scott Stark
Assignee: Jason Greene
An problem I ran into with using AS7 in a constrained environment that limited the number
of processes/threads a user could create was the number of threads being created for the
bootstrap service container. It would be useful if the ServiceContainer.ContainerExecutor
thread pool max threads was externalized. The higher the core count the more threads are
wasted if the purpose is to have as many AS7 instances running as possible as is the case
with the openshift express environment.
One simple approach would be to externalize this via a system property that could be
added to the ServerEnvironment ala:
{noformat}
diff --git a/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
b/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
index 60c78e7..3d93c5b 100644
--- a/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
+++ b/server/src/main/java/org/jboss/as/server/BootstrapImpl.java
@@ -23,6 +23,7 @@
package org.jboss.as.server;
import java.util.List;
+import java.util.concurrent.TimeUnit;
import org.jboss.as.controller.persistence.ConfigurationPersister;
import org.jboss.modules.Module;
@@ -46,7 +47,14 @@ import org.jboss.threads.JBossExecutors;
* @author <a href="mailto:david.lloyd@redhat.com">David M.
Lloyd</a>
*/
final class BootstrapImpl implements Bootstrap {
- private final ServiceContainer container =
ServiceContainer.Factory.create("jboss-as");
+ private static int MAX_THREADS = 2;
+ static {
+ String maxThreads =
SecurityActions.getSystemProperty("org.jboss.server.bootstrap.maxThreads");
+ if(maxThreads != null) {
+ MAX_THREADS = Integer.decode(maxThreads);
+ }
+ }
+ private final ServiceContainer container =
ServiceContainer.Factory.create("jboss-as", MAX_THREADS, 30, TimeUnit.SECONDS);
{noformat}
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira