Skip to content

Commit

Permalink
1. rename submodule to polardbx-glue
Browse files Browse the repository at this point in the history
2. optimize startup.sh jvm args
3. optimize entrypoint.sh
  • Loading branch information
agapple committed Dec 16, 2022
1 parent 55ca0c9 commit 4f946d5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
34 changes: 19 additions & 15 deletions polardbx-server/src/main/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4f946d5

Please sign in to comment.