diff --git a/assembly/pom.xml b/assembly/pom.xml index 5a3f263b6c..ae74485deb 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -294,6 +294,7 @@ ./work/jetty + 200 diff --git a/commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java b/commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java index ddceb18509..10e348d9f3 100644 --- a/commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java +++ b/commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java @@ -137,6 +137,7 @@ public class NiFiProperties extends Properties { public static final String WEB_HTTPS_PORT = "nifi.web.https.port"; public static final String WEB_HTTPS_HOST = "nifi.web.https.host"; public static final String WEB_WORKING_DIR = "nifi.web.jetty.working.directory"; + public static final String WEB_THREADS = "nifi.web.jetty.threads"; // ui properties public static final String UI_BANNER_TEXT = "nifi.ui.banner.text"; @@ -182,6 +183,7 @@ public class NiFiProperties extends Properties { public static final String DEFAULT_USER_CREDENTIAL_CACHE_DURATION = "24 hours"; public static final Integer DEFAULT_REMOTE_INPUT_PORT = null; public static final Path DEFAULT_TEMPLATE_DIRECTORY = Paths.get("conf", "templates"); + public static final int DEFAULT_WEB_THREADS = 200; public static final String DEFAULT_WEB_WORKING_DIR = "./work/jetty"; public static final String DEFAULT_NAR_WORKING_DIR = "./work/nar"; public static final String DEFAULT_COMPONENT_DOCS_DIRECTORY = "./work/docs/components"; @@ -499,6 +501,10 @@ public class NiFiProperties extends Properties { return sslPort; } + public int getWebThreads() { + return getIntegerProperty(WEB_THREADS, DEFAULT_WEB_THREADS); + } + public File getWebWorkingDirectory() { return new File(getProperty(WEB_WORKING_DIR, DEFAULT_WEB_WORKING_DIR)); } diff --git a/nar-bundles/framework-bundle/framework/resources/src/main/resources/conf/nifi.properties b/nar-bundles/framework-bundle/framework/resources/src/main/resources/conf/nifi.properties index 248c0b9c58..d6ae2bf4df 100644 --- a/nar-bundles/framework-bundle/framework/resources/src/main/resources/conf/nifi.properties +++ b/nar-bundles/framework-bundle/framework/resources/src/main/resources/conf/nifi.properties @@ -102,6 +102,7 @@ nifi.web.http.port=${nifi.web.http.port} nifi.web.https.host=${nifi.web.https.host} nifi.web.https.port=${nifi.web.https.port} nifi.web.jetty.working.directory=${nifi.jetty.work.dir} +nifi.web.jetty.threads=${nifi.web.jetty.threads} # security properties # nifi.sensitive.props.key= diff --git a/nar-bundles/framework-bundle/framework/web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java b/nar-bundles/framework-bundle/framework/web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java index 5d370904d2..95052a7b10 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java +++ b/nar-bundles/framework-bundle/framework/web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java @@ -108,7 +108,7 @@ public class JettyServer implements NiFiServer { * @param props the configuration */ public JettyServer(final NiFiProperties props) { - final QueuedThreadPool threadPool = new QueuedThreadPool(); + final QueuedThreadPool threadPool = new QueuedThreadPool(props.getWebThreads()); threadPool.setName("NiFi Web Server"); // create the server