Author: remy.maucherat(a)jboss.com
Date: 2011-03-16 06:09:18 -0400 (Wed, 16 Mar 2011)
New Revision: 1681
Modified:
trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
Log:
Reduce the poller size counts, as the Servlet 3 and event functionality is tied to a
matching processor,
making the functionality memory intensive.
Modified: trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2011-03-15 14:18:04 UTC (rev
1680)
+++ trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2011-03-16 10:09:18 UTC (rev
1681)
@@ -582,22 +582,6 @@
useSendfile = false;
}
- // Poller size defaults
- if (pollerSize <= 0) {
- if (org.apache.tomcat.util.Constants.LOW_MEMORY) {
- pollerSize = (1 * 1024);
- } else {
- pollerSize = (OS.IS_WIN32 || OS.IS_WIN64) ? (8 * 1024) : (32 * 1024);
- }
- }
- if (sendfileSize <= 0) {
- if (org.apache.tomcat.util.Constants.LOW_MEMORY) {
- sendfileSize = 128;
- } else {
- sendfileSize = (OS.IS_WIN32 || OS.IS_WIN64) ? (1 * 1024) : (16 * 1024);
- }
- }
-
long inetAddress = Address.info(addressStr, family,
port, 0, rootPool);
@@ -1442,6 +1426,18 @@
pool = Pool.create(serverSockPool);
actualPollerSize = pollerSize;
+ // Poller size defaults
+ if (actualPollerSize <= 0) {
+ if (org.apache.tomcat.util.Constants.LOW_MEMORY) {
+ if (event) {
+ actualPollerSize = 128;
+ } else {
+ actualPollerSize = 1024;
+ }
+ } else {
+ actualPollerSize = (OS.IS_WIN32 || OS.IS_WIN64) ? (8 * 1024) : (32 *
1024);
+ }
+ }
if ((OS.IS_WIN32 || OS.IS_WIN64) && (actualPollerSize > 1024)) {
// The maximum per poller to get reasonable performance is 1024
// Adjust poller size so that it won't reach the limit
@@ -2134,6 +2130,13 @@
protected void init() {
pool = Pool.create(serverSockPool);
int size = sendfileSize;
+ if (size <= 0) {
+ if (org.apache.tomcat.util.Constants.LOW_MEMORY) {
+ size = 128;
+ } else {
+ size = (OS.IS_WIN32 || OS.IS_WIN64) ? (1 * 1024) : (16 * 1024);
+ }
+ }
sendfilePollset = allocatePoller(size, pool, soTimeout);
if (sendfilePollset == 0 && size > 1024) {
size = 1024;
Modified: trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2011-03-15 14:18:04 UTC (rev
1680)
+++ trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2011-03-16 10:09:18 UTC (rev
1681)
@@ -171,7 +171,7 @@
/**
* Size of the socket poller.
*/
- protected int pollerSize = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? (1 * 1024)
: (32 * 1024);
+ protected int pollerSize = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 128 : (32
* 1024);
public void setPollerSize(int pollerSize) { this.pollerSize = pollerSize; }
public int getPollerSize() { return pollerSize; }
Show replies by date