Author: remy.maucherat(a)jboss.com
Date: 2012-10-04 10:27:42 -0400 (Thu, 04 Oct 2012)
New Revision: 2102
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/AbstractEndpoint.java
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/NioEndpoint.java
Log:
- Cleanup maxThreads and maxConnections, since they will be set properly in AS.
- Use the same defaults as for the APR connector.
Modified: branches/7.2.x/src/main/java/org/apache/tomcat/util/net/AbstractEndpoint.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/AbstractEndpoint.java 2012-10-04
13:21:08 UTC (rev 2101)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/net/AbstractEndpoint.java 2012-10-04
14:27:42 UTC (rev 2102)
@@ -89,13 +89,12 @@
/**
* 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);
/**
* The maximum number of connections
*/
- protected int maxConnections = 1024;
+ protected int maxConnections = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 1024 :
(32 * 1024);
/**
* Priority of the acceptor and poller threads.
@@ -105,7 +104,7 @@
/**
* Size of the sendfile (= concurrent files which can be served).
*/
- protected int sendfileSize = -1;
+ protected int sendfileSize = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 128 : (16 *
1024);
/**
* Server socket port.
Modified: branches/7.2.x/src/main/java/org/apache/tomcat/util/net/NioEndpoint.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/tomcat/util/net/NioEndpoint.java 2012-10-04
13:21:08 UTC (rev 2101)
+++ branches/7.2.x/src/main/java/org/apache/tomcat/util/net/NioEndpoint.java 2012-10-04
14:27:42 UTC (rev 2102)
@@ -242,7 +242,7 @@
running = true;
paused = false;
- // Start acceptor threads
+ // Start acceptor threads
for (int i = 0; i < acceptorThreadCount; i++) {
Thread acceptorThread = newThread(new Acceptor(), "Acceptor", daemon);
acceptorThread.start();
@@ -257,7 +257,7 @@
}
// Starting the event poller
- this.eventPoller = new EventPoller(this.maxThreads);
+ this.eventPoller = new EventPoller(this.maxConnections);
this.eventPoller.init();
Thread eventPollerThread = newThread(this.eventPoller, "EventPoller",
true);
eventPollerThread.start();
@@ -1639,7 +1639,7 @@
* Initialize the {@code Sendfile}
*/
protected void init() {
- this.size = maxThreads;
+ this.size = sendfileSize;
this.mutex = new Object();
this.counter = new AtomicInteger(0);
this.fileDatas = new ConcurrentLinkedQueue<SendfileData>();
Show replies by date