Set sshd.threads to at least 4.

Otherwise, weird hangs can occur, for example when using Git LFS.

See https://github.com/git-lfs/git-lfs/issues/3727

Change-Id: Ic19cb136bb37d62d8339b85c514c180f733e3465
This commit is contained in:
Florian Klink
2019-07-23 14:14:32 +02:00
committed by David Pursehouse
parent e8810fbcb6
commit 2a389469be
2 changed files with 3 additions and 2 deletions

View File

@@ -4239,7 +4239,8 @@ Number of threads to use when executing SSH command requests.
If additional requests are received while all threads are busy they If additional requests are received while all threads are busy they
are queued and serviced in a first-come-first-served order. are queued and serviced in a first-come-first-served order.
+ +
By default, 2x the number of CPUs available to the JVM. By default, 2x the number of CPUs available to the JVM (but at least 4
threads).
+ +
[NOTE] [NOTE]
When SSH daemon is enabled then this setting also defines the max number of When SSH daemon is enabled then this setting also defines the max number of

View File

@@ -28,7 +28,7 @@ public class ThreadSettingsConfig {
@Inject @Inject
ThreadSettingsConfig(@GerritServerConfig Config cfg) { ThreadSettingsConfig(@GerritServerConfig Config cfg) {
int cores = Runtime.getRuntime().availableProcessors(); int cores = Runtime.getRuntime().availableProcessors();
sshdThreads = cfg.getInt("sshd", "threads", 2 * cores); sshdThreads = cfg.getInt("sshd", "threads", Math.max(4, 2 * cores));
httpdMaxThreads = cfg.getInt("httpd", "maxThreads", 25); httpdMaxThreads = cfg.getInt("httpd", "maxThreads", 25);
int defaultDatabasePoolLimit = sshdThreads + httpdMaxThreads + 2; int defaultDatabasePoolLimit = sshdThreads + httpdMaxThreads + 2;
databasePoolLimit = cfg.getInt("database", "poolLimit", defaultDatabasePoolLimit); databasePoolLimit = cfg.getInt("database", "poolLimit", defaultDatabasePoolLimit);