Author: remy.maucherat(a)jboss.com
Date: 2012-04-25 12:51:10 -0400 (Wed, 25 Apr 2012)
New Revision: 2031
Modified:
branches/7.0.x/java/org/apache/coyote/ajp/Constants.java
branches/7.0.x/java/org/apache/coyote/http11/Constants.java
branches/7.0.x/java/org/apache/tomcat/util/net/AprEndpoint.java
branches/7.0.x/java/org/apache/tomcat/util/net/Constants.java
branches/7.0.x/java/org/apache/tomcat/util/net/JIoEndpoint.java
branches/7.0.x/webapps/docs/changelog.xml
trunk/java/org/apache/coyote/ajp/Constants.java
trunk/java/org/apache/coyote/http11/Constants.java
trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
trunk/java/org/apache/tomcat/util/net/Constants.java
trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
trunk/webapps/docs/changelog.xml
Log:
AS7-4151: Add system property to configure AJP packet size, and another for endpoint max
threads.
Modified: branches/7.0.x/java/org/apache/coyote/ajp/Constants.java
===================================================================
--- branches/7.0.x/java/org/apache/coyote/ajp/Constants.java 2012-04-23 15:52:44 UTC (rev
2030)
+++ branches/7.0.x/java/org/apache/coyote/ajp/Constants.java 2012-04-25 16:51:10 UTC (rev
2031)
@@ -96,7 +96,9 @@
/**
* Default maximum total byte size for a AJP packet
*/
- public static final int MAX_PACKET_SIZE = 8192;
+ public static final int MAX_PACKET_SIZE =
+
Integer.valueOf(System.getProperty("org.apache.coyote.ajp.MAX_PACKET_SIZE",
"8192")).intValue();
+
/**
* Size of basic packet header
*/
Modified: branches/7.0.x/java/org/apache/coyote/http11/Constants.java
===================================================================
--- branches/7.0.x/java/org/apache/coyote/http11/Constants.java 2012-04-23 15:52:44 UTC
(rev 2030)
+++ branches/7.0.x/java/org/apache/coyote/http11/Constants.java 2012-04-25 16:51:10 UTC
(rev 2031)
@@ -125,7 +125,8 @@
/**
* Default HTTP header buffer size.
*/
- public static final int DEFAULT_HTTP_HEADER_BUFFER_SIZE = 48 * 1024;
+ public static final int DEFAULT_HTTP_HEADER_BUFFER_SIZE =
+
Integer.valueOf(System.getProperty("org.apache.coyote.http11.DEFAULT_HTTP_HEADER_BUFFER_SIZE",
"8192")).intValue();
/* Various constant "strings" */
Modified: branches/7.0.x/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- branches/7.0.x/java/org/apache/tomcat/util/net/AprEndpoint.java 2012-04-23 15:52:44
UTC (rev 2030)
+++ branches/7.0.x/java/org/apache/tomcat/util/net/AprEndpoint.java 2012-04-25 16:51:10
UTC (rev 2031)
@@ -148,7 +148,7 @@
/**
* Maximum amount of worker threads.
*/
- protected int maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 32 : 32 *
Runtime.getRuntime().availableProcessors();
+ protected int maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 32 :
((Constants.MAX_THREADS == -1) ? 32 * Runtime.getRuntime().availableProcessors() :
Constants.MAX_THREADS);
public void setMaxThreads(int maxThreads) { this.maxThreads = maxThreads; }
public int getMaxThreads() { return maxThreads; }
Modified: branches/7.0.x/java/org/apache/tomcat/util/net/Constants.java
===================================================================
--- branches/7.0.x/java/org/apache/tomcat/util/net/Constants.java 2012-04-23 15:52:44 UTC
(rev 2030)
+++ branches/7.0.x/java/org/apache/tomcat/util/net/Constants.java 2012-04-25 16:51:10 UTC
(rev 2031)
@@ -24,6 +24,8 @@
*/
public final class Constants {
+ public static final int MAX_THREADS =
+
Integer.valueOf(System.getProperty("org.apache.tomcat.util.net.MAX_THREADS",
"-1")).intValue();
public static final boolean WAIT_FOR_THREAD =
Boolean.valueOf(System.getProperty("org.apache.tomcat.util.net.WAIT_FOR_THREAD",
"false")).booleanValue();
@@ -49,5 +51,4 @@
*/
public static final String SESSION_ID_KEY =
"javax.servlet.request.ssl_session_id";
-
}
Modified: branches/7.0.x/java/org/apache/tomcat/util/net/JIoEndpoint.java
===================================================================
--- branches/7.0.x/java/org/apache/tomcat/util/net/JIoEndpoint.java 2012-04-23 15:52:44
UTC (rev 2030)
+++ branches/7.0.x/java/org/apache/tomcat/util/net/JIoEndpoint.java 2012-04-25 16:51:10
UTC (rev 2031)
@@ -134,7 +134,7 @@
/**
* Maximum amount of worker threads.
*/
- protected int maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 64 : 512 *
Runtime.getRuntime().availableProcessors();
+ protected int maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 64 :
((Constants.MAX_THREADS == -1) ? 512 * Runtime.getRuntime().availableProcessors() :
Constants.MAX_THREADS);
public void setMaxThreads(int maxThreads) { this.maxThreads = maxThreads; }
public int getMaxThreads() { return maxThreads; }
Modified: branches/7.0.x/webapps/docs/changelog.xml
===================================================================
--- branches/7.0.x/webapps/docs/changelog.xml 2012-04-23 15:52:44 UTC (rev 2030)
+++ branches/7.0.x/webapps/docs/changelog.xml 2012-04-25 16:51:10 UTC (rev 2031)
@@ -16,6 +16,14 @@
<body>
<section name="JBoss Web 7.0.16.Final (remm)">
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ <jboss-jira>AS7-4151</jboss-jira>: Add system property to configure
AJP packet size, and another
+ for endpoint max threads. (remm)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Jasper">
<changelog>
<fix>
Modified: trunk/java/org/apache/coyote/ajp/Constants.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/Constants.java 2012-04-23 15:52:44 UTC (rev 2030)
+++ trunk/java/org/apache/coyote/ajp/Constants.java 2012-04-25 16:51:10 UTC (rev 2031)
@@ -96,7 +96,9 @@
/**
* Default maximum total byte size for a AJP packet
*/
- public static final int MAX_PACKET_SIZE = 8192;
+ public static final int MAX_PACKET_SIZE =
+
Integer.valueOf(System.getProperty("org.apache.coyote.ajp.MAX_PACKET_SIZE",
"8192")).intValue();
+
/**
* Size of basic packet header
*/
Modified: trunk/java/org/apache/coyote/http11/Constants.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Constants.java 2012-04-23 15:52:44 UTC (rev 2030)
+++ trunk/java/org/apache/coyote/http11/Constants.java 2012-04-25 16:51:10 UTC (rev 2031)
@@ -125,7 +125,8 @@
/**
* Default HTTP header buffer size.
*/
- public static final int DEFAULT_HTTP_HEADER_BUFFER_SIZE = 48 * 1024;
+ public static final int DEFAULT_HTTP_HEADER_BUFFER_SIZE =
+
Integer.valueOf(System.getProperty("org.apache.coyote.http11.DEFAULT_HTTP_HEADER_BUFFER_SIZE",
"8192")).intValue();
/* Various constant "strings" */
Modified: trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2012-04-23 15:52:44 UTC (rev
2030)
+++ trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2012-04-25 16:51:10 UTC (rev
2031)
@@ -148,7 +148,7 @@
/**
* Maximum amount of worker threads.
*/
- protected int maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 32 : 32 *
Runtime.getRuntime().availableProcessors();
+ protected int maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 32 :
((Constants.MAX_THREADS == -1) ? 32 * Runtime.getRuntime().availableProcessors() :
Constants.MAX_THREADS);
public void setMaxThreads(int maxThreads) { this.maxThreads = maxThreads; }
public int getMaxThreads() { return maxThreads; }
Modified: trunk/java/org/apache/tomcat/util/net/Constants.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/Constants.java 2012-04-23 15:52:44 UTC (rev
2030)
+++ trunk/java/org/apache/tomcat/util/net/Constants.java 2012-04-25 16:51:10 UTC (rev
2031)
@@ -24,6 +24,8 @@
*/
public final class Constants {
+ public static final int MAX_THREADS =
+
Integer.valueOf(System.getProperty("org.apache.tomcat.util.net.MAX_THREADS",
"-1")).intValue();
public static final boolean WAIT_FOR_THREAD =
Boolean.valueOf(System.getProperty("org.apache.tomcat.util.net.WAIT_FOR_THREAD",
"false")).booleanValue();
Modified: trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2012-04-23 15:52:44 UTC (rev
2030)
+++ trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2012-04-25 16:51:10 UTC (rev
2031)
@@ -133,7 +133,7 @@
/**
* Maximum amount of worker threads.
*/
- protected int maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 64 : 512 *
Runtime.getRuntime().availableProcessors();
+ protected int maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 64 :
((Constants.MAX_THREADS == -1) ? 512 * Runtime.getRuntime().availableProcessors() :
Constants.MAX_THREADS);
public void setMaxThreads(int maxThreads) { this.maxThreads = maxThreads; }
public int getMaxThreads() { return maxThreads; }
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2012-04-23 15:52:44 UTC (rev 2030)
+++ trunk/webapps/docs/changelog.xml 2012-04-25 16:51:10 UTC (rev 2031)
@@ -44,6 +44,10 @@
<add>
Protocol upgrade API. (remm)
</add>
+ <fix>
+ <jboss-jira>AS7-4151</jboss-jira>: Add system property to configure
AJP packet size, and another
+ for endpoint max threads. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
Show replies by date