Best Startup Script

Discussion in 'Server & Community Management' started by BungeeTheCookie, May 30, 2016.

  1. Hello,

    I was wondering what the best/optimal startup script for Spigot/Thermos(Cauldron)/PaperSpigot/whatever would be if you were using 1GB-3GB and 4-6GB of RAM?

    I currently use this for my Cauldron servers:
    java -XX:+UseG1GC -XX:+UseFastAccessorMethods -XX:+OptimizeStringConcat -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -XX:+AggressiveOpts -XX:MaxGCPauseMillis=10 -XX:+UseStringDeduplication -Xms1G -Xmx1G -XX:hashCode=5 -Dfile.encoding=UTF-8 -jar <jar name>
    Thanks!
     
    • Informative Informative x 1
  2. I use this startup script on a 8GB VPS with Java 8
    Code (Text):
    java -Dfile.encoding=UTF-8 -Xmx5G -Xms5G -jar paperspigot.jar
    Works without any issues, I already tried the startup script in this thread: https://www.spigotmc.org/threads/gu...remove-lag-fix-tps-improve-performance.21726/ but instead of improving performance it instead got worse (from 20/19TPS to 16TPS!) so I only use this basic startup script and it works perfectly.
     
    • Friendly Friendly x 1
  3. I usually write something like this:
    Code (Text):
    #!/usr/bin/env bash

    while true; do
        java -Xmx4G -Xms4G -XX:+AlwaysPreTouch -XX:+DisableExplicitGC \
            -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=50 \
            -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 \
            -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AggressiveOpts \
            -jar spigot.jar
       
        echo "Restarting in five seconds, press Ctrl-C to cancel."
        sleep 5
    done
     
     
    • Like Like x 2
  4. I'm now running my server with the -XX:+UseG1GC flag, the server is running with no issues.

    IIRC the flag that caused the TPS drop was the "-XX:+AggressiveOpts" flag (once I tried to run my server with the same script I shared before + the AggressiveOpts, the TPS dropped from 19/20 to 16/15, after removing the flag and restarting the server stopped lagging).
     
  5. All credit for the Java flags in my thread goes to @Aikar.
    That's very odd. Could you give me the output of these two commands?
    Code (Text):
    java -XX:-AggressiveOpts -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version
    java -XX:+AggressiveOpts -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version
     
  6. Thank you for your responses :D
     
  7. https://gist.github.com/MrPowerGamerBR/a7d8802f20c2e9f5e1cc4e3d14d3666f

    Host: 8GB VPS OpenVZ from ExtraVM

    I remember one day using your startup script, but the server was too laggy, so I used the simple script I'm using right now and the lag stopped.

    One day I did decide to add one flag from your startup script (however I'm not sure what it was, but IIRC it wasn't related to GC) and then the server TPS dropped, so I'm now using the script I shared before (with the UseG1GC flag)

    Timings, if you need it (Yeah, tracker 1 timing/tile entity count is broken, I done a bad Timings v2 implementation, however PaperSpigot 1.7.10 has the same TPS drop issue, and when I update to 1.8/1.9 the issue is WAY worse.): https://timings.aikar.co/v2/?id=80dac7cb61304de6bc3093edfbfe04bd