From 0ae62fedcfdab654c78b98ea418497cc85bffc57 Mon Sep 17 00:00:00 2001 From: Luca Milanesio Date: Fri, 4 Sep 2015 07:56:00 -0700 Subject: [PATCH] Increase default HTTP incoming connection queue Based on the repo-discuss mailing list discussions [1] and [2], it seems that the previous limit (50) was a bit low as default value. It makes more sense to increase it and avoid people struggling to understand the obscure Jetty exceptions thrown when the queue size is too small. If you have over 200 incoming requests queued, possibly there is something more serious to investigate in Gerrit and thus makes sense to avoid queueing them and consume incoming sockets and file-descriptors. [1] https://groups.google.com/forum/#!topic/repo-discuss/-2hnEOqQA7M [2] https://groups.google.com/forum/#!topic/repo-discuss/Fuk3GW0rcuU Change-Id: Ifd1615c981ae33d460b178307257acd4e6722335 --- Documentation/config-gerrit.txt | 2 +- .../main/java/com/google/gerrit/pgm/http/jetty/JettyServer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index 14523ec438..c648725298 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -2201,7 +2201,7 @@ Maximum number of client connections which can enter the worker thread pool waiting for a worker thread to become available. 0 sets the queue size to the Integer.MAX_VALUE. + -By default 50. +By default 200. [[httpd.maxWait]]httpd.maxWait:: + diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/JettyServer.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/JettyServer.java index 5028e4d309..9f94dbf537 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/JettyServer.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/JettyServer.java @@ -353,7 +353,7 @@ public class JettyServer { private ThreadPool threadPool(Config cfg) { int maxThreads = cfg.getInt("httpd", null, "maxthreads", 25); int minThreads = cfg.getInt("httpd", null, "minthreads", 5); - int maxQueued = cfg.getInt("httpd", null, "maxqueued", 50); + int maxQueued = cfg.getInt("httpd", null, "maxqueued", 200); int idleTimeout = (int)MILLISECONDS.convert(60, SECONDS); int maxCapacity = maxQueued == 0 ? Integer.MAX_VALUE