diff --git a/.circleci/config.yml b/.circleci/config.yml index 42b4466d..1c98efc9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,4 +14,9 @@ workflows: version: 2 build: jobs: - - minecraft_server + - minecraft_server: + filters: + branches: + ignore: + - armv7 + - multiarch diff --git a/README.md b/README.md index afe1a095..25459e12 100644 --- a/README.md +++ b/README.md @@ -1040,6 +1040,12 @@ To enable remote JMX, such as for profiling with VisualVM or JMC, add the enviro -e ENABLE_JMX=true -p 7091:7091 +### Enable Aikar's Flags + +[Aikar has does some research](https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/) into finding the optimal JVM flags for GC tuning, which becomes more important as more users are connected concurrently. The set of flags documented there can be added using + + -e USE_AIKAR_FLAGS=true + ### HTTP Proxy You may configure the use of an HTTP/HTTPS proxy by passing the proxy's URL via the `PROXY` diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index a0ee38dd..be80eeee 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -43,7 +43,7 @@ fi log "Checking for JSON files." JSON_FILES=$(find . -maxdepth 1 -name '*.json') for j in $JSON_FILES; do - if [[ $(cat $j | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') == "" ]]; then + if [[ $(cat "$j" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') == "" ]]; then log "Fixing JSON $j" echo '[]' > $j fi @@ -61,7 +61,7 @@ fi for c in /config/* do if [ -f "$c" ]; then - log Copying configuration `basename "$c"` + log Copying configuration $(basename "$c") cp -rf "$c" /data/config fi done @@ -115,6 +115,31 @@ if isTrue ${ENABLE_JMX}; then log "JMX is enabled. Make sure you have port forwarding for ${JMX_PORT}" fi +if isTrue ${USE_AIKAR_FLAGS}; then + # From https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/ + JVM_OPTS="${JVM_XX_OPTS} + -XX:+UseG1GC -XX:+ParallelRefProcEnabled + -XX:MaxGCPauseMillis=200 + -XX:+UnlockExperimentalVMOptions + -XX:+DisableExplicitGC + -XX:-OmitStackTraceInFastThrow + -XX:+AlwaysPreTouch + -XX:G1NewSizePercent=30 + -XX:G1MaxNewSizePercent=40 + -XX:G1HeapRegionSize=8M + -XX:G1ReservePercent=20 + -XX:G1HeapWastePercent=5 + -XX:G1MixedGCCountTarget=8 + -XX:InitiatingHeapOccupancyPercent=15 + -XX:G1MixedGCLiveThresholdPercent=90 + -XX:G1RSetUpdatingPauseTimePercent=5 + -XX:SurvivorRatio=32 + -XX:MaxTenuringThreshold=1 + -Dusing.aikars.flags=true + -Daikars.new.flags=true + " +fi + mcServerRunnerArgs="--stop-duration 60s" if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then