You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/01/12 13:54:06 UTC

[incubator-iotdb] branch master updated: Revert "[IOTDB-397]fix gc log collection in start-server.sh scripts" (#730)

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

qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new e9d3d96  Revert "[IOTDB-397]fix gc log collection in start-server.sh scripts" (#730)
e9d3d96 is described below

commit e9d3d96a39c2ac90c954e878f73020f077b1518c
Author: Xiangdong Huang <hx...@qq.com>
AuthorDate: Sun Jan 12 21:53:57 2020 +0800

    Revert "[IOTDB-397]fix gc log collection in start-server.sh scripts" (#730)
    
    * Revert "set all gc log as info level (though some startup memory allocation log is debug and trace still)"
    
    This reverts commit 0a796a240fa398ff366d34b0815c491108f1a515.
    
    * Revert "fix gc log collection in start-server.sh scripts"
    
    This reverts commit b7a30552d62abd3e9a80ac983f9269b0a3364c5f.
---
 .../UserGuide/3-Server/4-Config Manual.md          | 19 +------------
 .../UserGuide/3-Server/4-Config Manual.md          | 20 +-------------
 server/src/assembly/resources/conf/iotdb-env.bat   | 29 +++++++++-----------
 server/src/assembly/resources/conf/iotdb-env.sh    | 31 +++++-----------------
 .../src/assembly/resources/sbin/start-server.bat   |  2 +-
 server/src/assembly/resources/sbin/start-server.sh |  6 +----
 6 files changed, 23 insertions(+), 84 deletions(-)

diff --git a/docs/Documentation-CHN/UserGuide/3-Server/4-Config Manual.md b/docs/Documentation-CHN/UserGuide/3-Server/4-Config Manual.md
index e99c288..2310c17 100644
--- a/docs/Documentation-CHN/UserGuide/3-Server/4-Config Manual.md	
+++ b/docs/Documentation-CHN/UserGuide/3-Server/4-Config Manual.md	
@@ -404,21 +404,4 @@
 |描述| Kerberos 认证原则|
 |类型| String |
 |默认值|your principal |
-|改后生效方式|重启服务器生效|
-
-
-## 开启GC日志
-GC日志默认是关闭的。为了性能调优,用户可能会需要手机GC信息。
-若要打开GC日志,则需要在启动IoTDB Server的时候加上"printgc"参数:
-
-```bash
-sbin/start-server.sh printgc
-```
-或者
-
-```bash
-sbin\start-server.bat printgc
-```
-
-GC日志会被存储在`IOTDB_HOME/logs/gc.log`. 至多会存储10个gc.log文件,每个文件最多10MB。
-
+|改后生效方式|重启服务器生效|
\ No newline at end of file
diff --git a/docs/Documentation/UserGuide/3-Server/4-Config Manual.md b/docs/Documentation/UserGuide/3-Server/4-Config Manual.md
index a16cdcd..c95490b 100644
--- a/docs/Documentation/UserGuide/3-Server/4-Config Manual.md	
+++ b/docs/Documentation/UserGuide/3-Server/4-Config Manual.md	
@@ -442,22 +442,4 @@ The detail of each variables are as follows:
 |Description| Kerberos pricipal|
 |Type| String |
 |Default|your principal |
-|Effective|After restart system|
-
-## Enable GC log
-GC log is off by default.
-For performance tuning, you may want to collect the GC info. 
-
-To enable GC log, just add a paramenter "printgc" when you start the server.
-
-```bash
-sbin/start-server.sh printgc
-```
-Or
-```bash
-sbin\start-server.bat printgc
-```
-
-GC log is stored at `IOTDB_HOME/logs/gc.log`.
-There will be at most 10 gc.log.* files and each one can reach to 10MB.
-
+|Effective|After restart system|
\ No newline at end of file
diff --git a/server/src/assembly/resources/conf/iotdb-env.bat b/server/src/assembly/resources/conf/iotdb-env.bat
index fcf9fba..e04a409 100644
--- a/server/src/assembly/resources/conf/iotdb-env.bat
+++ b/server/src/assembly/resources/conf/iotdb-env.bat
@@ -54,27 +54,24 @@ for /f "tokens=1-3" %%j in ('java -version 2^>^&1') do (
 	set BIT_VERSION=%%l
 )
 IF "%BIT_VERSION%" == "64-Bit" (
-	rem 64-bit Java
-	echo Detect 64-bit Java, maximum memory allocation pool = 2GB, initial memory allocation pool = 2GB
-	set IOTDB_HEAP_OPTS=-Xmx2G -Xms2G
+  rem 64bit, Maximum heap size
+  set MAX_HEAP_SIZE="2G"
+  rem 64bit, Minimum heap size
+  set HEAP_NEWSIZE="2G"
 ) ELSE (
-	rem 32-bit Java
-	echo Detect 32-bit Java, maximum memory allocation pool = 512MB, initial memory allocation pool = 512MB
-	set IOTDB_HEAP_OPTS=-Xmx512M -Xms512M
+  rem 32bit, Maximum heap size
+  set MAX_HEAP_SIZE="512M"
+  rem 32bit, Minimum heap size
+  set HEAP_NEWSIZE="512M"
 )
 
+@REM MAX_HEAP_SIZE="2G"
+@REM HEAP_NEWSIZE="2G"
+
+set IOTDB_HEAP_OPTS=-Xmx%MAX_HEAP_SIZE% -Xms%HEAP_NEWSIZE%
+
 @REM You can put your env variable here
 @REM set JAVA_HOME=%JAVA_HOME%
 
 :end_config_setting
-@REM set gc log.
-IF "%1" equ "printgc" (
-	IF %JAVA_VERSION% == 8 (
-	    md %IOTDB_HOME%\logs
-		set IOTDB_HEAP_OPTS=%IOTDB_HEAP_OPTS% -Xloggc:"%IOTDB_HOME%\logs\gc.log" -XX:+PrintGCDateStamps -XX:+PrintGCDetails  -XX:+PrintGCApplicationStoppedTime -XX:+PrintPromotionFailure -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M
-	) ELSE (
-		md %IOTDB_HOME%\logs
-		set IOTDB_HEAP_OPTS=%IOTDB_HEAP_OPTS%  -Xlog:gc=info,heap*=trace,age*=debug,safepoint=info,promotion*=trace:file="%IOTDB_HOME%\logs\gc.log":time,uptime,pid,tid,level:filecount=10,filesize=10485760
-	)
-)
 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).
\ No newline at end of file
diff --git a/server/src/assembly/resources/conf/iotdb-env.sh b/server/src/assembly/resources/conf/iotdb-env.sh
index 583e93b..3d8e39b 100755
--- a/server/src/assembly/resources/conf/iotdb-env.sh
+++ b/server/src/assembly/resources/conf/iotdb-env.sh
@@ -128,31 +128,12 @@ fi
 
 version_arr=(${JVM_VERSION//./ })
 
-#GC log path has to be defined here because it needs to access CASSANDRA_HOME
 if [ "${version_arr[0]}" = "1" ] ; then
-    # Java 8
-    MAJOR_VERSION=${version_arr[1]}
-    echo "$IOTDB_JMX_OPTS" | grep -q "^-[X]loggc"
-    if [ "$?" = "1" ] ; then # [X] to prevent ccm from replacing this line
-        # only add -Xlog:gc if it's not mentioned in jvm-server.options file
-        mkdir -p ${IOTDB_HOME}/logs
-        if [ "$#" -ge "1" -a "$1" == "printgc" ]; then
-            IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Xloggc:${IOTDB_HOME}/logs/gc.log  -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -XX:+PrintPromotionFailure -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M"
-        fi
-    fi
+  MAJOR_VERSION=${version_arr[1]}
+  IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Xloggc:${IOTDB_HOME}/gc.log -XX:+PrintGCDateStamps -XX:+PrintGCDetails"
 else
-    #JDK 11 and others
-    MAJOR_VERSION=${version_arr[0]}
-    # See description of https://bugs.openjdk.java.net/browse/JDK-8046148 for details about the syntax
-    # The following is the equivalent to -XX:+PrintGCDetails -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M
-    echo "$IOTDB_JMX_OPTS" | grep -q "^-[X]log:gc"
-    if [ "$?" = "1" ] ; then # [X] to prevent ccm from replacing this line
-        # only add -Xlog:gc if it's not mentioned in jvm-server.options file
-        mkdir -p ${IOTDB_HOME}/logs
-        if [ "$#" -ge "1" -a "$1" == "printgc" ]; then
-            IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Xlog:gc=info,heap*=info,age*=info,safepoint=info,promotion*=info:file=${IOTDB_HOME}/logs/gc.log:time,uptime,pid,tid,level:filecount=10,filesize=10485760"
-        fi
-    fi
+  MAJOR_VERSION=${version_arr[0]}
+  IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Xloggc:${IOTDB_HOME}/gc.log"
 fi
 
 
@@ -169,10 +150,10 @@ JMX_LOCAL=no
 JMX_PORT="31999"
 
 if [ "JMX_LOCAL" = "yes" ]; then
-	IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Diotdb.jmx.local.port=$JMX_PORT"
+	IOTDB_JMX_OPTS="-Diotdb.jmx.local.port=$JMX_PORT"
 	IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
 else
-	IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false  -Dcom.sun.management.jmxremote.ssl=false"
+	IOTDB_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false  -Dcom.sun.management.jmxremote.ssl=false"
 	IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT "
 fi
 
diff --git a/server/src/assembly/resources/sbin/start-server.bat b/server/src/assembly/resources/sbin/start-server.bat
index 823df0e..57ba10d 100755
--- a/server/src/assembly/resources/sbin/start-server.bat
+++ b/server/src/assembly/resources/sbin/start-server.bat
@@ -59,7 +59,7 @@ set IOTDB_CONF=%IOTDB_HOME%\conf
 set IOTDB_LOGS=%IOTDB_HOME%\logs
 
 IF EXIST "%IOTDB_CONF%\iotdb-env.bat" (
-    CALL "%IOTDB_CONF%\iotdb-env.bat" %1
+    CALL "%IOTDB_CONF%\iotdb-env.bat"
     ) ELSE (
     echo "can't find %IOTDB_CONF%\iotdb-env.bat"
     )
diff --git a/server/src/assembly/resources/sbin/start-server.sh b/server/src/assembly/resources/sbin/start-server.sh
index 009e65a..ed5e826 100755
--- a/server/src/assembly/resources/sbin/start-server.sh
+++ b/server/src/assembly/resources/sbin/start-server.sh
@@ -31,11 +31,7 @@ IOTDB_CONF=${IOTDB_HOME}/conf
 # IOTDB_LOGS=${IOTDB_HOME}/logs
 
 if [ -f "$IOTDB_CONF/iotdb-env.sh" ]; then
-    if [ "$#" -ge "1" -a "$1" == "printgc" ]; then
-      . "$IOTDB_CONF/iotdb-env.sh" "printgc"
-    else
-        . "$IOTDB_CONF/iotdb-env.sh"
-    fi
+    . "$IOTDB_CONF/iotdb-env.sh"
 else
     echo "can't find $IOTDB_CONF/iotdb-env.sh"
 fi