From: fhanik Date: Wed, 28 Feb 2007 23:28:35 +0000 (+0000) Subject: By default dont use direct buffers, in a situation where a very large number of conne... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a07f5f85b13ccb123cbca3df9acc0fcab67828d2;p=tomcat7.0 By default dont use direct buffers, in a situation where a very large number of connections, direct buffers are much slower git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@513060 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/SocketProperties.java b/java/org/apache/tomcat/util/net/SocketProperties.java index 746117e58..71c9c2c6b 100644 --- a/java/org/apache/tomcat/util/net/SocketProperties.java +++ b/java/org/apache/tomcat/util/net/SocketProperties.java @@ -18,24 +18,24 @@ package org.apache.tomcat.util.net; import java.net.Socket; import java.net.SocketException; /** - * Properties that can be set in the <Connector> element + * Properties that can be set in the <Connector> element * in server.xml. All properties are prefixed with "socket." * and are currently only working for the Nio connector - * + * * @author Filip Hanik */ public class SocketProperties { /** - * Enable/disable key cache, this bounced cache stores + * Enable/disable key cache, this bounced cache stores * KeyAttachment objects to reduce GC * Default is 100 * -1 is unlimited * 0 is disabled */ protected int keyCache = 500; - + /** - * Enable/disable poller event cache, this bounded cache stores + * Enable/disable poller event cache, this bounded cache stores * PollerEvent objects to reduce GC for the poller * Default is -1 (unlimited) * -1 is unlimited @@ -43,13 +43,13 @@ public class SocketProperties { * >0 the max number of objects to keep in cache. */ protected int eventCache = 500; - + /** * Enable/disable direct buffers for the network buffers * Default value is enabled */ - protected boolean directBuffer = true; + protected boolean directBuffer = false; /** * Socket receive buffer size in bytes (SO_RCVBUF) * Default value is 25188 @@ -60,19 +60,19 @@ public class SocketProperties { * Default value is 43800 */ protected int txBufSize = 43800; - + /** * The application read buffer size in bytes. * Default value is rxBufSize */ protected int appReadBufSize = 8192; - + /** * The application write buffer size in bytes * Default value is txBufSize */ protected int appWriteBufSize = 8192; - + /** * NioChannel pool size for the endpoint, * this value is how many channels @@ -80,7 +80,7 @@ public class SocketProperties { * Default value is 500 */ protected int bufferPool = 500; - + /** * Buffer pool size in bytes to be cached @@ -88,7 +88,7 @@ public class SocketProperties { * Default value is 100MB (1024*1024*100 bytes) */ protected int bufferPoolSize = 1024*1024*100; - + /** * TCP_NO_DELAY option, default is true */ diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml index bc80e4467..4ce5c865f 100644 --- a/webapps/docs/config/http.xml +++ b/webapps/docs/config/http.xml @@ -413,7 +413,7 @@

Whether to allow comet servlets or not, Default value is true.

-

Boolean value, whether to use direct ByteBuffers or java mapped ByteBuffers. Default is true +

Boolean value, whether to use direct ByteBuffers or java mapped ByteBuffers. Default is false
When you are using direct buffers, make sure you allocate the appropriate amount of memory for the direct memory space. On Sun's JDK that would be something like -XX:MaxDirectMemorySize=256m