From 4f946d5a0ad0d16367307331e1875799fda91d8d Mon Sep 17 00:00:00 2001 From: "jianghang.loujh" Date: Fri, 16 Dec 2022 15:59:23 +0800 Subject: [PATCH] 1. rename submodule to polardbx-glue 2. optimize startup.sh jvm args 3. optimize entrypoint.sh --- .gitmodules | 2 +- docker/entrypoint.sh | 2 +- polardbx-server/src/main/bin/startup.sh | 34 ++++++++++++++----------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.gitmodules b/.gitmodules index d033d2a6e..d11576cf6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "polardbx-rpc"] path = polardbx-rpc - url = https://github.com/ApsaraDB/galaxyglue.git + url = https://github.com/polardb/polardbx-glue.git diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 53518f647..67f474e90 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -17,7 +17,7 @@ GALAXYSQL_HOME=/home/admin/drds-server function galaxysql_pid() { - jps | grep Tddl | cut -d ' ' -f 1 + ps auxf | grep java | grep TddlLauncher | awk '{print $2}' } function kill_and_clean() { diff --git a/polardbx-server/src/main/bin/startup.sh b/polardbx-server/src/main/bin/startup.sh index 06254825f..b17e0c3d0 100644 --- a/polardbx-server/src/main/bin/startup.sh +++ b/polardbx-server/src/main/bin/startup.sh @@ -398,22 +398,26 @@ if [ -n "$str" ]; then freecount=`expr $memory / 1024 / 1024` fi - if [ $freecount -lt 2048 ] ; then - JAVA_OPTS="-server -Xms1024m -Xmx1024m " - elif [ $freecount -le 4096 ] ; then - JAVA_OPTS="-server -Xms2g -Xmx2g " - elif [ $freecount -le 8192 ] ; then - JAVA_OPTS="-server -Xms4g -Xmx4g " - elif [ $freecount -le 16384 ] ; then - JAVA_OPTS="-server -Xms10g -Xmx10g -XX:MaxDirectMemorySize=3g" - elif [ $freecount -le 32768 ] ; then - JAVA_OPTS="-server -Xms24g -Xmx24g -XX:MaxDirectMemorySize=6g" - elif [ $freecount -le 65536 ] ; then - JAVA_OPTS="-server -Xms50g -Xmx50g -XX:MaxDirectMemorySize=12g" - elif [ $freecount -le 131072 ] ; then + if [ $freecount -ge 131072 ] ; then JAVA_OPTS="-server -Xms110g -Xmx110g -XX:MaxDirectMemorySize=24g" - elif [ $freecount -gt 131072 ] ; then - JAVA_OPTS="-server -Xms120g -Xmx120g -XX:MaxDirectMemorySize=32g" + elif [ $freecount -ge 65536 ] ; then + JAVA_OPTS="-server -Xms50g -Xmx50g -XX:MaxDirectMemorySize=12g" + elif [ $freecount -ge 32768 ] ; then + JAVA_OPTS="-server -Xms24g -Xmx24g -XX:MaxDirectMemorySize=6g" + elif [ $freecount -ge 16384 ] ; then + JAVA_OPTS="-server -Xms10g -Xmx10g -XX:MaxDirectMemorySize=3g" + elif [ $freecount -ge 8192 ] ; then + JAVA_OPTS="-server -Xms4g -Xmx4g " + elif [ $freecount -ge 4096 ] ; then + JAVA_OPTS="-server -Xms2g -Xmx2g " + elif [ $freecount -ge 2048 ] ; then + JAVA_OPTS="-server -Xms1024m -Xmx1024m " + elif [ $freecount -ge 1024 ] ; then + JAVA_OPTS="-server -Xms512m -Xmx512m " + elif [ $freecount -ge 512 ] ; then + JAVA_OPTS="-server -Xms256m -Xmx256m " + elif [ $freecount -ge 256 ] ; then + JAVA_OPTS="-server -Xms128m -Xmx128m " fi else echo "not support 32-bit java startup"