Author: markt Date: Thu May 5 15:53:57 2011 New Revision: 1099855 URL: http://svn.apache.org/viewvc?rev=1099855&view=rev Log: Use maxThreads value as the default for maxConnections with the BIO connector.
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java tomcat/trunk/webapps/docs/config/ajp.xml tomcat/trunk/webapps/docs/config/http.xml Modified: tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java?rev=1099855&r1=1099854&r2=1099855&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java Thu May 5 15:53:57 2011 @@ -65,6 +65,14 @@ public class JIoEndpoint extends Abstrac protected ServerSocket serverSocket = null; + // ------------------------------------------------------------ Constructor + + public JIoEndpoint() { + // Set maxConnections to zero so we can tell if the user has specified + // their own value on the connector when we reach bind() + setMaxConnections(0); + } + // ------------------------------------------------------------- Properties /** @@ -351,6 +359,12 @@ public class JIoEndpoint extends Abstrac if (acceptorThreadCount == 0) { acceptorThreadCount = 1; } + // Initialize maxConnections + if (getMaxConnections() == 0) { + // User hasn't set a value - use the default + setMaxConnections(getMaxThreads()); + } + if (serverSocketFactory == null) { if (isSSLEnabled()) { serverSocketFactory = Modified: tomcat/trunk/webapps/docs/config/ajp.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/ajp.xml?rev=1099855&r1=1099854&r2=1099855&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/config/ajp.xml (original) +++ tomcat/trunk/webapps/docs/config/ajp.xml Thu May 5 15:53:57 2011 @@ -314,6 +314,20 @@ connectionTimeout attribute.</p> </attribute> + <attribute name="maxConnections" required="false"> + <p>The maximum number of connections that the server will accept and + process at any given time. When this number has been reached, the server + will not accept any more connections until the number of connections + falls below this value. The operating system may still accept + connections based on the <code>acceptCount</code> setting. Default value + varies by connector type. For BIO the default is the value of + <strong>maxThreads</strong>.For APR/native, the default is + <code>8192</code>.</p> + <p>Note that for APR/native on Windows, the configured value will be + reduced to the highest multiple of 1024 that is less than or equal to + maxConnections. This is done for performance reasons.</p> + </attribute> + <attribute name="maxThreads" required="false"> <p>The maximum number of request processing threads to be created by this <strong>Connector</strong>, which therefore determines the Modified: tomcat/trunk/webapps/docs/config/http.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/http.xml?rev=1099855&r1=1099854&r2=1099855&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/config/http.xml (original) +++ tomcat/trunk/webapps/docs/config/http.xml Thu May 5 15:53:57 2011 @@ -356,8 +356,9 @@ will not accept any more connections until the number of connections falls below this value. The operating system may still accept connections based on the <code>acceptCount</code> setting. Default value - varies by connector type. For BIO and NIO the default is - <code>10000</code>. For APR/native, the default is <code>8192</code>.</p> + varies by connector type. For BIO the default is the value of + <strong>maxThreads</strong>. For NIO the default is <code>10000</code>. + For APR/native, the default is <code>8192</code>.</p> <p>Note that for APR/native on Windows, the configured value will be reduced to the highest multiple of 1024 that is less than or equal to maxConnections. This is done for performance reasons.</p> @@ -1173,18 +1174,18 @@ <p>Below is a small chart that shows how the connectors differentiate.</p> <source> - Java Blocking Connector Java Nio Blocking Connector APR/native Connector - BIO NIO APR - Classname Http11Protocol Http11NioProtocol Http11AprProtocol - Tomcat Version 3.x onwards 6.x onwards 5.5.x onwards - Support Polling NO YES YES - Polling Size N/A Unlimited - Restricted by mem Unlimited - Configurable - Read HTTP Request Blocking Non Blocking Blocking - Read HTTP Body Blocking Sim Blocking Blocking - Write HTTP Response Blocking Sim Blocking Blocking - SSL Support Java SSL Java SSL OpenSSL - SSL Handshake Blocking Non blocking Blocking - Max Connections maxConnections See polling size See polling size + Java Blocking Connector Java Nio Blocking Connector APR/native Connector + BIO NIO APR + Classname Http11Protocol Http11NioProtocol Http11AprProtocol + Tomcat Version 3.x onwards 6.x onwards 5.5.x onwards + Support Polling NO YES YES + Polling Size N/A maxConnections maxConnections + Read HTTP Request Blocking Non Blocking Blocking + Read HTTP Body Blocking Sim Blocking Blocking + Write HTTP Response Blocking Sim Blocking Blocking + SSL Support Java SSL Java SSL OpenSSL + SSL Handshake Blocking Non blocking Blocking + Max Connections maxConnections maxConnections maxConnections </source> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org