You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2020/01/08 16:23:36 UTC

[tomcat] branch master updated: Plan larger update than anticipated to default cache sizes

This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 80a9422  Plan larger update than anticipated to default cache sizes
80a9422 is described below

commit 80a9422e9721cb772acf17aefe294692018af1e4
Author: remm <re...@apache.org>
AuthorDate: Wed Jan 8 17:23:22 2020 +0100

    Plan larger update than anticipated to default cache sizes
    
    bufferPoolSize is configurable but not used at all at the moment, but
    should probably have more significance.
---
 TOMCAT-NEXT.txt                                       |  2 +-
 java/org/apache/tomcat/util/net/SocketProperties.java | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/TOMCAT-NEXT.txt b/TOMCAT-NEXT.txt
index 07aa147..87eadaa 100644
--- a/TOMCAT-NEXT.txt
+++ b/TOMCAT-NEXT.txt
@@ -67,6 +67,6 @@ New items for 10.0.x onwards:
 
 14. Remove unused NIO blocking code.
 
-15. Remove caches in Endpoint for trivial object (SocketProcessorBase, PollerEvent).
+15. Change SocketProperties cache sizes default values.
 
 16. Share configuration between HTTP/1.1 and nested HTTP/2 rather than duplicating.
diff --git a/java/org/apache/tomcat/util/net/SocketProperties.java b/java/org/apache/tomcat/util/net/SocketProperties.java
index 706cc5e..488f6f7 100644
--- a/java/org/apache/tomcat/util/net/SocketProperties.java
+++ b/java/org/apache/tomcat/util/net/SocketProperties.java
@@ -39,6 +39,7 @@ public class SocketProperties {
      * Default is 500
      * -1 is unlimited
      * 0 is disabled
+     * TODO: The default will be changed to 0 in Tomcat 10
      */
     protected int processorCache = 500;
 
@@ -49,6 +50,7 @@ public class SocketProperties {
      * -1 is unlimited
      * 0 is disabled
      * &gt;0 the max number of objects to keep in cache.
+     * TODO: The default will be changed to 0 in Tomcat 10
      */
     protected int eventCache = 500;
 
@@ -93,6 +95,11 @@ public class SocketProperties {
      * this value is how many channels
      * -1 means unlimited cached, 0 means no cache
      * Default value is 500
+     * TODO: The default should be changed in Tomcat 10, actually it should be
+     *   bufferPoolSize / (appReadBufSize + appWriteBufSize), assuming the SSL
+     *   buffers are ignored (that would be logical), and the value would be 6400.
+     *   So the default value will be changed to a new default value like -2 to
+     *   set a dynamic value based on bufferPoolSize in that case.
      */
     protected int bufferPool = 500;
 
@@ -100,6 +107,13 @@ public class SocketProperties {
      * Buffer pool size in bytes to be cached
      * -1 means unlimited, 0 means no cache
      * Default value is 100MB (1024*1024*100 bytes)
+     * TODO: The default value to be used could rather be based on the
+     *   JVM max heap, otherwise it could be a problem in some
+     *   environments. Big servers also need to use a much higher default,
+     *   while small cloud based ones should use 0 instead.
+     *   Possible default value strategy:
+     *     heap < 1GB: 0
+     *     heap >= 1GB: heap / 16
      */
     protected int bufferPoolSize = 1024*1024*100;
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org