You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2021/11/27 09:10:36 UTC

[iotdb] branch 0.12maxCachedBuffer created (now 124b5eb)

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

xiangweiwei pushed a change to branch 0.12maxCachedBuffer
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at 124b5eb  add MAX_CACHED_BUFFER_SIZE

This branch includes the following new commits:

     new 124b5eb  add MAX_CACHED_BUFFER_SIZE

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[iotdb] 01/01: add MAX_CACHED_BUFFER_SIZE

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiangweiwei pushed a commit to branch 0.12maxCachedBuffer
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 124b5eb8eb0318ab532d17c17217520ce2533c5a
Author: Alima777 <wx...@gmail.com>
AuthorDate: Sat Nov 27 17:09:44 2021 +0800

    add MAX_CACHED_BUFFER_SIZE
---
 server/src/assembly/resources/conf/iotdb-env.bat | 4 ++++
 server/src/assembly/resources/conf/iotdb-env.sh  | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/server/src/assembly/resources/conf/iotdb-env.bat b/server/src/assembly/resources/conf/iotdb-env.bat
index 6a165ba..72a1237 100755
--- a/server/src/assembly/resources/conf/iotdb-env.bat
+++ b/server/src/assembly/resources/conf/iotdb-env.bat
@@ -103,9 +103,13 @@ for /f "tokens=1-3" %%j in ('java -version 2^>^&1') do (
 
 @REM maximum direct memory size
 set MAX_DIRECT_MEMORY_SIZE=%MAX_HEAP_SIZE%
+@REM Max cached buffer size, Note: unit can only be B!
+@REM which equals DIRECT_MEMORY_SIZE / threads number that may use direct memory / buffer cache size(IOV_MAX) depends on operating system
+set MAX_DIRECT_MEMORY_SIZE=%max_heap_size_in_mb% * 1024 * 1024 / 16 / 1024
 
 set IOTDB_HEAP_OPTS=-Xmx%MAX_HEAP_SIZE% -Xms%HEAP_NEWSIZE% -Xlog:gc:"..\gc.log"
 set IOTDB_HEAP_OPTS=%IOTDB_HEAP_OPTS% -XX:MaxDirectMemorySize=%MAX_DIRECT_MEMORY_SIZE%
+set IOTDB_HEAP_OPTS=%IOTDB_HEAP_OPTS% -Djdk.nio.maxCachedBufferSize=%MAX_CACHED_BUFFER_SIZE%
 
 @REM You can put your env variable here
 @REM set JAVA_HOME=%JAVA_HOME%
diff --git a/server/src/assembly/resources/conf/iotdb-env.sh b/server/src/assembly/resources/conf/iotdb-env.sh
index 9d6abe0..e9ecec8 100755
--- a/server/src/assembly/resources/conf/iotdb-env.sh
+++ b/server/src/assembly/resources/conf/iotdb-env.sh
@@ -205,8 +205,12 @@ calculate_heap_sizes
 #MAX_HEAP_SIZE="2G"
 # Minimum heap size
 #HEAP_NEWSIZE="2G"
-# maximum direct memory size
+# Maximum direct memory size
 MAX_DIRECT_MEMORY_SIZE=${MAX_HEAP_SIZE}
+# Max cached buffer size, Note: unit can only be B!
+# which equals DIRECT_MEMORY_SIZE / threads number that may use direct memory / buffer cache size(IOV_MAX) depends on operating system
+MAX_CACHED_BUFFER_SIZE=`expr $max_heap_size_in_mb \* 1024 \* 1024 / 16 / 1024`
+echo $MAX_CACHED_BUFFER_SIZE
 
 #true or false
 #DO NOT FORGET TO MODIFY THE PASSWORD FOR SECURITY (${IOTDB_CONF}/jmx.password and ${IOTDB_CONF}/jmx.access)
@@ -240,6 +244,7 @@ fi
 IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Xms${HEAP_NEWSIZE}"
 IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Xmx${MAX_HEAP_SIZE}"
 IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxDirectMemorySize=${MAX_DIRECT_MEMORY_SIZE}"
+IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Djdk.nio.maxCachedBufferSize=${MAX_CACHED_BUFFER_SIZE}"
 
 echo "Maximum memory allocation pool = ${MAX_HEAP_SIZE}B, initial memory allocation pool = ${HEAP_NEWSIZE}B"
 echo "If you want to change this configuration, please check conf/iotdb-env.sh(Unix or OS X, if you use Windows, check conf/iotdb-env.bat)."