diff options
author | James Moger <james.moger@gitblit.com> | 2013-05-03 19:15:05 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-05-03 19:15:05 -0400 |
commit | b58492239c4c3acc3b4434625d08827450fde078 (patch) | |
tree | 56bed166a650e0261e160bec1efb2b56a6a6062c | |
parent | 40aa84507640cd2a980757e7910a63310474eb87 (diff) | |
download | gitblit-b58492239c4c3acc3b4434625d08827450fde078.tar.gz gitblit-b58492239c4c3acc3b4434625d08827450fde078.zip |
GO NIO connector thread pool size setting
-rw-r--r-- | releases.moxie | 2 | ||||
-rw-r--r-- | src/main/distrib/data/gitblit.properties | 7 | ||||
-rw-r--r-- | src/main/java/com/gitblit/GitBlitServer.java | 14 |
3 files changed, 17 insertions, 6 deletions
diff --git a/releases.moxie b/releases.moxie index ce717727..7c0ec8f4 100644 --- a/releases.moxie +++ b/releases.moxie @@ -33,6 +33,7 @@ r17: { - Updated Japanese translation
additions:
+ - Added GO http/https connector thread pool size setting - Added a server setting to force a particular translation/Locale for all sessions
- Added smart Git Daemon serving. If enabled, git:// access will be offered for any repository which permits anonymous access. If the repository permits anonymous cloning, anonymous git:// clone will be permitted while anonmymous git:// pushes will be rejected. - Option to automatically tag branch tips on each push with an incremental revision number
@@ -81,6 +82,7 @@ r17: { - { name: 'git.daemonPort', defaultValue: 0 }
- { name: 'git.defaultIncrementalPushTagPrefix', defaultValue: 'r' }
- { name: 'web.forceDefaultLocale', defaultValue: ' ' }
+ - { name: 'server.nioThreadPoolSize', defaultValue: 50 } }
#
diff --git a/src/main/distrib/data/gitblit.properties b/src/main/distrib/data/gitblit.properties index f47ad078..43185f57 100644 --- a/src/main/distrib/data/gitblit.properties +++ b/src/main/distrib/data/gitblit.properties @@ -1250,6 +1250,13 @@ server.tempFolder = ${baseFolder}/temp # RESTART REQUIRED
server.useNio = true
+# If using Jetty NIO connectors, specify the maximum number of concurrent +# http/https worker threads to allow. +# +# SINCE 1.3.0 +# RESTART REQUIRED +server.nioThreadPoolSize = 50 + # Context path for the GO application. You might want to change the context
# path if running Gitblit behind a proxy layer such as mod_proxy.
#
diff --git a/src/main/java/com/gitblit/GitBlitServer.java b/src/main/java/com/gitblit/GitBlitServer.java index 79d3d6bd..a41b8a2c 100644 --- a/src/main/java/com/gitblit/GitBlitServer.java +++ b/src/main/java/com/gitblit/GitBlitServer.java @@ -203,7 +203,7 @@ public class GitBlitServer { // conditionally configure the http connector
if (params.port > 0) {
- Connector httpConnector = createConnector(params.useNIO, params.port);
+ Connector httpConnector = createConnector(params.useNIO, settings.getInteger(Keys.server.nioThreadPoolSize, 50), params.port); String bindInterface = settings.getString(Keys.server.httpBindInterface, null);
if (!StringUtils.isEmpty(bindInterface)) {
logger.warn(MessageFormat.format("Binding connector on port {0,number,0} to {1}",
@@ -262,7 +262,7 @@ public class GitBlitServer { if (serverKeyStore.exists()) {
Connector secureConnector = createSSLConnector(params.alias, serverKeyStore, serverTrustStore, params.storePassword,
- caRevocationList, params.useNIO, params.securePort, params.requireClientCertificates);
+ caRevocationList, params.useNIO, settings.getInteger(Keys.server.nioThreadPoolSize, 50), params.securePort, params.requireClientCertificates); String bindInterface = settings.getString(Keys.server.httpsBindInterface, null);
if (!StringUtils.isEmpty(bindInterface)) {
logger.warn(MessageFormat.format(
@@ -410,15 +410,16 @@ public class GitBlitServer { *
* @param useNIO
* @param port
+ * @param maxThreads * @return an http connector
*/
- private Connector createConnector(boolean useNIO, int port) {
+ private Connector createConnector(boolean useNIO, int port, int maxThreads) { Connector connector;
if (useNIO) {
logger.info("Setting up NIO SelectChannelConnector on port " + port);
SelectChannelConnector nioconn = new SelectChannelConnector();
nioconn.setSoLingerTime(-1);
- nioconn.setThreadPool(new QueuedThreadPool(20));
+ nioconn.setThreadPool(new QueuedThreadPool(maxThreads)); connector = nioconn;
} else {
logger.info("Setting up SocketConnector on port " + port);
@@ -443,12 +444,13 @@ public class GitBlitServer { * @param storePassword
* @param caRevocationList
* @param useNIO
+ * @param nioThreadPoolSize * @param port
* @param requireClientCertificates
* @return an https connector
*/
private Connector createSSLConnector(String certAlias, File keyStore, File clientTrustStore,
- String storePassword, File caRevocationList, boolean useNIO, int port,
+ String storePassword, File caRevocationList, boolean useNIO, int nioThreadPoolSize, int port, boolean requireClientCertificates) {
GitblitSslContextFactory factory = new GitblitSslContextFactory(certAlias,
keyStore, clientTrustStore, storePassword, caRevocationList);
@@ -462,7 +464,7 @@ public class GitBlitServer { } else {
factory.setWantClientAuth(true);
}
- ssl.setThreadPool(new QueuedThreadPool(20));
+ ssl.setThreadPool(new QueuedThreadPool(nioThreadPoolSize)); connector = ssl;
} else {
logger.info("Setting up NIO SslSocketConnector on port " + port);
|