Align connector implementations with documented default for processorCache
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 18 Apr 2011 15:38:07 +0000 (15:38 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 18 Apr 2011 15:38:07 +0000 (15:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1094621 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/AbstractProtocolHandler.java
java/org/apache/coyote/http11/Http11AprProtocol.java
java/org/apache/coyote/http11/Http11NioProtocol.java
java/org/apache/coyote/http11/Http11Protocol.java
webapps/docs/changelog.xml
webapps/docs/config/ajp.xml
webapps/docs/config/http.xml

index c528490..50d4e85 100644 (file)
@@ -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;
index a112b9d..93a18d2 100644 (file)
@@ -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;
index 0cd5d7f..195df7f 100644 (file)
@@ -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);
     }
 
 
index 23da806..8c41dc3 100644 (file)
@@ -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);
     }
 
     
index e341891..2dab80f 100644 (file)
         if it is configured for SSL and an invalid value is provided for
         SSLProtocol. (markt)
       </fix>
+      <fix>
+        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. 
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">
index e20663b..06eadf6 100644 (file)
     <attribute name="processorCache" required="false">
       <p>The protocol handler caches Processor objects to speed up performance.
       This setting dictates how many of these objects get cached.
-      <code>-1</code> means unlimited, default is <code>200</code>. Set this
-      value somewhere close to your maxThreads value.</p>
+      <code>-1</code> means unlimited, default is <code>200</code>. 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).</p>
     </attribute>
       
     <attribute name="requiredSecret" required="false">
index 09b47c7..af79d63 100644 (file)
     <attribute name="processorCache" required="false">
       <p>The protocol handler caches Processor objects to speed up performance.
       This setting dictates how many of these objects get cached.
-      <code>-1</code> means unlimited, default is <code>200</code>. Set this
-      value somewhere close to your maxThreads value.</p>
+      <code>-1</code> means unlimited, default is <code>200</code>. 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).</p>
     </attribute>
       
     <attribute name="restrictedUserAgents" required="false">