Enable sshd.batchThreads by default

Change default value of sshd.batchThreads from 0 to 1 or 2 depending on
the core counts. When Gerrit runs on single code node 1 will be used as
default, 2 otherwise.

Change-Id: I4c04157e9edead9cdf0105aebc5d1658fa60f494
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This commit is contained in:
Dariusz Luksza
2015-11-09 18:44:35 +01:00
parent 6add9edc1e
commit 145de47203
2 changed files with 2 additions and 2 deletions

View File

@@ -3427,7 +3427,7 @@ If the number of threads requested for non-interactive users is larger
than the total number of threads allocated in sshd.threads, then the than the total number of threads allocated in sshd.threads, then the
value of sshd.threads is increased to accommodate the requested value. value of sshd.threads is increased to accommodate the requested value.
+ +
By default, 0. By default is 1 on single core node, 2 otherwise.
[[sshd.streamThreads]]sshd.streamThreads:: [[sshd.streamThreads]]sshd.streamThreads::
+ +

View File

@@ -35,7 +35,7 @@ public class CommandExecutorQueueProvider implements QueueProvider {
final WorkQueue queues) { final WorkQueue queues) {
final int cores = Runtime.getRuntime().availableProcessors(); final int cores = Runtime.getRuntime().availableProcessors();
poolSize = config.getInt("sshd", "threads", 3 * cores / 2); poolSize = config.getInt("sshd", "threads", 3 * cores / 2);
batchThreads = config.getInt("sshd", "batchThreads", 0); batchThreads = config.getInt("sshd", "batchThreads", cores == 1 ? 1 : 2);
if (batchThreads > poolSize) { if (batchThreads > poolSize) {
poolSize += batchThreads; poolSize += batchThreads;
} }