From: markt Date: Mon, 18 Apr 2011 15:38:07 +0000 (+0000) Subject: Align connector implementations with documented default for processorCache X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2289f8a7c8eb8dd2759e216dea02bebe21e94e7d;p=tomcat7.0 Align connector implementations with documented default for processorCache git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1094621 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/AbstractProtocolHandler.java b/java/org/apache/coyote/AbstractProtocolHandler.java index c5284908e..50d4e853b 100644 --- a/java/org/apache/coyote/AbstractProtocolHandler.java +++ b/java/org/apache/coyote/AbstractProtocolHandler.java @@ -98,11 +98,12 @@ public abstract class AbstractProtocolHandler implements ProtocolHandler, /** * The maximum number of idle processors that will be retained in the cache - * and re-used with a subsequent request. The default is -1, unlimited, - * although in that case there will never be more Processor objects than - * there are threads in the associated thread pool. + * and re-used with a subsequent request. The default is 200. A value of -1 + * means unlimited. In the unlimited case, the theoretical maximum number of + * cached Processor objects is {@link #getMaxConnections()} although it will + * usually be closer to {@link #getMaxThreads()}. */ - protected int processorCache = -1; + protected int processorCache = 200; public int getProcessorCache() { return this.processorCache; } public void setProcessorCache(int processorCache) { this.processorCache = processorCache; diff --git a/java/org/apache/coyote/http11/Http11AprProtocol.java b/java/org/apache/coyote/http11/Http11AprProtocol.java index a112b9ddd..93a18d2e7 100644 --- a/java/org/apache/coyote/http11/Http11AprProtocol.java +++ b/java/org/apache/coyote/http11/Http11AprProtocol.java @@ -76,7 +76,6 @@ public class Http11AprProtocol extends AbstractHttp11Protocol { setSoLinger(Constants.DEFAULT_CONNECTION_LINGER); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY); - setProcessorCache(-1); } private final Http11ConnectionHandler cHandler; diff --git a/java/org/apache/coyote/http11/Http11NioProtocol.java b/java/org/apache/coyote/http11/Http11NioProtocol.java index 0cd5d7faf..195df7fff 100644 --- a/java/org/apache/coyote/http11/Http11NioProtocol.java +++ b/java/org/apache/coyote/http11/Http11NioProtocol.java @@ -74,7 +74,6 @@ public class Http11NioProtocol extends AbstractHttp11JsseProtocol { setSoLinger(Constants.DEFAULT_CONNECTION_LINGER); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY); - setProcessorCache(200); } diff --git a/java/org/apache/coyote/http11/Http11Protocol.java b/java/org/apache/coyote/http11/Http11Protocol.java index 23da8065b..8c41dc33b 100644 --- a/java/org/apache/coyote/http11/Http11Protocol.java +++ b/java/org/apache/coyote/http11/Http11Protocol.java @@ -74,7 +74,6 @@ public class Http11Protocol extends AbstractHttp11JsseProtocol { setSoLinger(Constants.DEFAULT_CONNECTION_LINGER); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY); - setProcessorCache(200); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index e34189167..2dab80f70 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -92,6 +92,13 @@ if it is configured for SSL and an invalid value is provided for SSLProtocol. (markt) + + Align all the connector implementations with the documented default + setting for processorCache of 200. This changes the default from -1 + (unlimited) for the AJP-BIO, AJP-APR and HTTP-APR connectors. Additional + information was also added to the documentation on how to select an + appropriate value. + diff --git a/webapps/docs/config/ajp.xml b/webapps/docs/config/ajp.xml index e20663bc7..06eadf6e8 100644 --- a/webapps/docs/config/ajp.xml +++ b/webapps/docs/config/ajp.xml @@ -333,8 +333,11 @@

The protocol handler caches Processor objects to speed up performance. This setting dictates how many of these objects get cached. - -1 means unlimited, default is 200. Set this - value somewhere close to your maxThreads value.

+ -1 means unlimited, default is 200. If not using + Servlet 3.0 asynchronous processing, a good default is to use the same as + the maxThreads setting. If using Servlet 3.0 asynchronous processing, a + good default is to use the larger of maxThreads and the maximum number of + expected concurrent requests (synchronous and asynchronous).

diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml index 09b47c73d..af79d63a7 100644 --- a/webapps/docs/config/http.xml +++ b/webapps/docs/config/http.xml @@ -406,8 +406,11 @@

The protocol handler caches Processor objects to speed up performance. This setting dictates how many of these objects get cached. - -1 means unlimited, default is 200. Set this - value somewhere close to your maxThreads value.

+ -1 means unlimited, default is 200. If not using + Servlet 3.0 asynchronous processing, a good default is to use the same as + the maxThreads setting. If using Servlet 3.0 asynchronous processing, a + good default is to use the larger of maxThreads and the maximum number of + expected concurrent requests (synchronous and asynchronous).