How To Improve Minecraft Server Performance

Discussion in 'Bukkit Help' started by TnT, Jan 15, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    TBK

    Hmm memory leak of the big kind, could be a plugin. Try to test your plugins one by one. A scheduled restart might also be an idea.
     
  2. Offline

    pomo4ka

    I mounted the world to the virtual disk, as described here to see prices. It is necessary to plug "Backup", every hour. Once the backup runs, the world is rolled back to its original position.
     
  3. Offline

    TnT Retired Staff

    You should backup as often as you feel comfortable. If you server crashes, RAM gets wiped out, which will also wipe out anything in your ramdisk.

    However, backing up the server shouldn't cause anything to rollback. How are you performing the backups?
     
  4. Offline

    pomo4ka

    I'm using "ubuntu server" and wrote a script to backup the world.
     
  5. Offline

    TnT Retired Staff

    Care to share that script? Might be something in that doing what you aren't expecting.
     
  6. Offline

    pomo4ka

    Once stood on the "Win Server 2008" and everything was normal, except for the load on working memory. The problem is that when the backup runs, the world rolls back an hour.
     
  7. Offline

    TnT Retired Staff

    Ok, walk through the steps of your backup then - I run backups hourly and don't experience the same issue.
     
  8. Offline

    pomo4ka

    We still worth plugin "Backup", it may well affect?
     
  9. Offline

    TnT Retired Staff

    Yes, sounds like your backup plugin may be the culprit.
     
  10. Offline

    Kainzo

    Has anyone successfully gotten 90+ players with no lag?
     
  11. Offline

    xcanner

    Im gonna test out a ram disk later this week. Our world is 2.3 GB atm, im running on ubuntu and have 16 GB RAM.

    Is it better to mount ramfs over tmpfs?
     
  12. Offline

    Maeyanie

    Just discovered this thread... what I use, instead of a pure ramdrive, is zram from http://code.google.com/p/compcache/ (included in 'staging' on newer kernels too)

    It gives you a LZO-compressed RAM device, upon which you can make and mount any regular filesystem (ext4, btrfs, etc.) It's very nearly as fast as a real ramdrive, LZO is a really fast algorithm, but it uses a lot less memory.

    It still has to be backed up to real storage regularly though, either via cron job, or some bukkit plugin (I use Essentials to run a shell script to do it.)
     
  13. Offline

    Chlamydia_13

    Ugh, I Hate Being A Noob.... I Didnt Understand Anything He Said After He Wants you To Install Those 2 Things... I Really Need Help... Anyone Wanna TeamView Me? Please
    Send Me A Message Or E-mail Damonische@gmail.com
     
  14. Offline

    Michael_BoG

    Would this method be faster than using Ubuntu's standard ramdisk? See this for more info.
     
  15. Offline

    Kalemar

    There's been a lot of discussion over the best java parameters to use. Has anyone tested the various suggestions and come up with what gives the best performance gains?
     
  16. Offline

    Michael_BoG

    Just wondering, anyone got any smart scripts which copies the data from the ramdisk to the hdd every say 5 minutes?
     
  17. Offline

    Orcworm

  18. Offline

    Michael_BoG

    The script there doesn't work.
     
  19. Offline

    Orcworm

    I used a ramdisk for around two months with that script, the problem is at your end.
     
  20. Offline

    Michael_BoG

    Edit: fixed.
     
  21. Offline

    Ziden

    please, help me with the startup script, i want to understand what i am doing.

    the last command will run after bukkit runs, after bukkit runs aint the RAMDISK going to be empty ?
    i have a big startup script, could someone help me adapting this into the script ? im very noobish at shell script.
    This is the actual script im using:

    Code:
    backupdir=~/bkp/
    bukkitdir=~/kom/
    bukkitfilename=craftbukkit-0.0.1-SNAPSHOT.jar
    bukkitupdate=craftbukkit-updater.jar
    
    backupmsg="Making Backup"
    
    dateformat=$(date '+%Y%m%dh%Hm%M')
    
    # Make sure you change this to the name of your world folder! Add additional worlds by separating them with a white space. If you only have one world, change this to have only one value like "world" or "creative".
    declare -a worlds=(Knights)
    numworlds=${#worlds[@]}
    
    # Set these for the amount of RAM you want to allocate. Good practice is to have the numbers match.
    # This is the Java heap max and initial size.
    
    javaparams="-Xmx7G -XX:ParallelGCThreads=8 -server -Xincgc -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:+AggressiveOpts -XX:+CMSParallelRemarkEnabled -XX:+DisableExplicitGC -XX:MaxGCPauseMillis=500 -XX:SurvivorRatio=16 -XX:TargetSurvivorRatio=90 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -Xnoclassgc -XX:UseSSE=3 -XX:PermSize=128m -XX:LargePageSizeInBytes=4m"
    
    # You can find this location with "whereis java". Make sure this points to the binary.
    
    javaloc=/usr/bin/java
    
    # This currently points to the "preferred" release for bukkit which is kind of like a stable version.
    # Change this value if you want to use the snapshot release.
    bukkiturl=http://ci.bukkit.org/job/dev-CraftBukkit/promotion/latest/Recommended/artifact/target/craftbukkit-0.0.1-SNAPSHOT.jar
    
    startbukkit()
    {
        if [ "$(screen -ls | grep bukkit)" == "" ] ; then
            cd $bukkitdir
            screen -S bukkit -dmS $javaloc $javaparams -jar $bukkitdir$bukkitfilename
            echo "Starting bukkit server."
        else
            echo "Bukkit is already running."
            exit 0
        fi
    }
    
    stopbukkit()
    {
        if [ "$(screen -ls | grep bukkit)" == "" ] ; then
            echo "Bukkit is not running."
            exit 0
        else
            screen -S bukkit -p 0 -X stuff "stop$(echo -ne '\r')"
            sleep 5
        fi
    }
    
    updatebukkit()
    {
        if [ "$(screen -ls | grep bukkit)" == "" ] ; then
            sleep 0
        else
            screen -S bukkit -p 0 -X stuff "say Going down for an update in 60 seconds.$(echo -ne '\r')"
            sleep 55
            screen -S bukkit -p 0 -X stuff "say Going down for an update in 5 seconds.$(echo -ne '\r')"
            sleep 5
            stopbukkit
        fi
    
        wget -O $bukkitdir$bukkitupdate $bukkiturl
        sleep 5
        mv $bukkitdir$bukkitupdate $bukkitdir$bukkitfilename
        sleep 5
    }
    
    backupbukkit()
    {
        echo "Starting multiworld backup..."
        if [ "$(screen -ls | grep bukkit)" == "" ] ; then
            sleep 0
        else
            screen -S bukkit -p 0 -X stuff "say '$backupmsg' $(echo -ne '\r')"
            screen -S bukkit -p 0 -X stuff "save-all$(echo -ne '\r')"
            sleep 5
            screen -S bukkit -p 0 -X stuff "save-off$(echo -ne '\r')"
        fi
        if [ -d $backupdir ] ; then
            sleep 0
        else
            mkdir -p $backupdir
        fi
        for ((i=0;i<$numworlds;i++)); do
            cp -R $bukkitdir${worlds[$i]} $backupdir$dateformat
            echo "Saving '${worlds[$i]}' to '$backupdir$dateformat'"
        done
    
        if [ "$(screen -ls | grep bukkit)" == "" ] ; then
            sleep 0
        else
            sleep 5
            screen -S bukkit -p 0 -X stuff "save-on$(echo -ne '\r')"
        fi
        echo "Backup complete."
    }
    
    case $1 in
        start)
            startbukkit
            ;;
        stop)
            stopbukkit
            ;;
        restart)
            stopbukkit
            sleep 5
            startbukkit
            ;;
        update)
            updatebukkit
            ;;
        backup)
            backupbukkit
            ;;
        friendlystop)
            screen -S bukkit -p 0 -X stuff "say Going down in 5 minutes.$(echo -ne '\r')"
            sleep 240
            screen -S bukkit -p 0 -X stuff "say Going down in 60 seconds.$(echo -ne '\r')"
            sleep 55
            screen -S bukkit -p 0 -X stuff "say Going down in 5 seconds.$(echo -ne '\r')"
            sleep 5
            stopbukkit
            ;;
        *)
            echo "Usage: $0 {start|stop|restart|update|backup|friendlystop}"
    esac
    
    exit 0
    The modification i tryed is with the rsync
    command:

    Code:
    backupdir=~/bkp/
    bukkitdir=~/kom/
    VOLATILE="/kom/KOM/"
    PERMANENT="/kom/KOM_Real/"
    bukkitfilename=craftbukkit-0.0.1-SNAPSHOT.jar
    bukkitupdate=craftbukkit-updater.jar
    
    backupmsg="Salvando o Servidor da RAM pro HD ! Pode lagar um pouco !"
    
    dateformat=$(date '+%Y%m%dh%Hm%M')
    
    # Make sure you change this to the name of your world folder! Add additional worlds by separating them with a white space. If you only have one world, change this to have only one value like "world" or "creative".
    declare -a worlds=(Knights)
    numworlds=${#worlds[@]}
    
    # Set these for the amount of RAM you want to allocate. Good practice is to have the numbers match.
    # This is the Java heap max and initial size.
    
    javaparams="-Xmx7G -XX:ParallelGCThreads=8 -server -Xincgc -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:+AggressiveOpts -XX:+CMSParallelRemarkEnabled -XX:+DisableExplicitGC -XX:MaxGCPauseMillis=500 -XX:SurvivorRatio=16 -XX:TargetSurvivorRatio=90 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -Xnoclassgc -XX:UseSSE=3 -XX:PermSize=128m -XX:LargePageSizeInBytes=4m"
    
    # You can find this location with "whereis java". Make sure this points to the binary.
    
    javaloc=/usr/bin/java
    
    # This currently points to the "preferred" release for bukkit which is kind of like a stable version.
    # Change this value if you want to use the snapshot release.
    bukkiturl=http://ci.bukkit.org/job/dev-CraftBukkit/promotion/latest/Recommended/artifact/target/craftbukkit-0.0.1-SNAPSHOT.jar
    
    startbukkit()
    {
        if [ "$(screen -ls | grep bukkit)" == "" ] ; then
            cd $bukkitdir
            rsync -r -t -v "$VOLATILE" "$PERMANENT"
        cp -r backup/KOM ./
            screen -S bukkit -dmS $javaloc $javaparams -jar $bukkitdir$bukkitfilename
            echo "Starting bukkit server."
            rm -r backup/
            mkdir backup/
            cp -r KOM/ backup/
        else
            echo "Bukkit is already running."
            exit 0
        fi
    }
    
    stopbukkit()
    {
        if [ "$(screen -ls | grep bukkit)" == "" ] ; then
            echo "Bukkit is not running."
            exit 0
        else
            screen -S bukkit -p 0 -X stuff "stop$(echo -ne '\r')"
            sleep 5
        fi
    }
    
    updatebukkit()
    {
        if [ "$(screen -ls | grep bukkit)" == "" ] ; then
            sleep 0
        else
            screen -S bukkit -p 0 -X stuff "say Going down for an update in 60 seconds.$(echo -ne '\r')"
            sleep 55
            screen -S bukkit -p 0 -X stuff "say Going down for an update in 5 seconds.$(echo -ne '\r')"
            sleep 5
            stopbukkit
        fi
    
        wget -O $bukkitdir$bukkitupdate $bukkiturl
        sleep 5
        mv $bukkitdir$bukkitupdate $bukkitdir$bukkitfilename
        sleep 5
    }
    
    backupbukkit()
    {
        echo "Starting multiworld backup..."
        if [ "$(screen -ls | grep bukkit)" == "" ] ; then
            sleep 0
        else
            screen -S bukkit -p 0 -X stuff "say '$backupmsg' $(echo -ne '\r')"
            screen -S bukkit -p 0 -X stuff "save-all$(echo -ne '\r')"
            sleep 5
            screen -S bukkit -p 0 -X stuff "save-off$(echo -ne '\r')"
        fi
        if [ -d $backupdir ] ; then
            sleep 0
        else
            mkdir -p $backupdir
        fi
        for ((i=0;i<$numworlds;i++)); do
            cp -R $bukkitdir${worlds[$i]} $backupdir$dateformat
            echo "Saving '${worlds[$i]}' to '$backupdir$dateformat'"
        done
    
        if [ "$(screen -ls | grep bukkit)" == "" ] ; then
            sleep 0
        else
            sleep 5
            screen -S bukkit -p 0 -X stuff "save-on$(echo -ne '\r')"
        fi
        rsync -r -t -v "$VOLATILE" "$PERMANENT"
        echo "Backup complete."
    }
    
    case $1 in
        start)
            startbukkit
            ;;
        stop)
            stopbukkit
            ;;
        restart)
            stopbukkit
            sleep 5
            startbukkit
            ;;
        update)
            updatebukkit
            ;;
        backup)
            backupbukkit
            ;;
        friendlystop)
            screen -S bukkit -p 0 -X stuff "say Going down in 5 minutes.$(echo -ne '\r')"
            sleep 240
            screen -S bukkit -p 0 -X stuff "say Going down in 60 seconds.$(echo -ne '\r')"
            sleep 55
            screen -S bukkit -p 0 -X stuff "say Going down in 5 seconds.$(echo -ne '\r')"
            sleep 5
            stopbukkit
            ;;
        *)
            echo "Usage: $0 {start|stop|restart|update|backup|friendlystop}"
    esac
    
    exit 0
    Note the Start and Backup differences. Will that work ? Im afraid to try this and loose my server heh
    I couldnt try this anyway, when i run my startup script, heres what it goes

    Code:
    rsync: change_dir "/kom/KOM" failed: No such file or directory (2)
    rsync: mkdir "/kom/KOM_Real" failed: No such file or directory (2)
    rsync error: error in file IO (code 11) at main.c(595) [Receiver=3.0.7]
    rsync: connection unexpectedly closed (9 bytes received so far) [sender]
    
    when i try to do the mount command, it says theres no mount point on /root/kom/KOM =(

    I would really apreciate any help, as 100 players are laggin the server world badly. Please.
     
  22. Offline

    Therawroy

    Hi Guys and Girls,

    first, sorry if my english is not the best, but i am german ;)
    second, for the last 20 days i was experimenting with java 1.7.0 like a chicken on crack. Why you ask ? Because i have only a vServer 32Bit with 6GB RAM .... and NO chance to change it to 64bit :p :p -- Provider sucks, but i change in a few days.

    So to give you some info about my problem:

    [ ALL TESTED AND WORKING ! Dont you believe me ? Send me a PM and i invite you ;) ]

    1x Craftbukkit953+ with 73 MP Plugins and 4 Worlds (world, nether, dungeon, skylands) on Port 9997 and with "dynmap"

    --> AND ! <--

    1x Craftbukkit953 (modded) with 18 MP Plugins and 5 SP Plugins and 1 World (very big skylandtype) on Port 9996

    To avoid the 2GB Memory Problem with 32bit java and Ubuntu, i installed a PAE Kernel .... but to be honest, its crap and not properbly working for JAVA and / or Minecraft. You can change the Memory from Xmx2048 to something like Xmx2548 and it starts .... but it also dies when you reach 2,1 GB RAM

    I even put the whole MAP and PLUGINS and CRAFTBUKKIT into the "tmpfs" Folder (ramfs isnt usable in vServer) to accelerate it .... but its only a small help .... and NO Help for the 2,1GB Problem. [<-- RAMDISK]

    My virtual Server Specs:
    - DualCore AMD Opteron // 4 GB RAM + 2 GB RAM FLEX = 6 GB RAM // 70 GB HDD // 32 Bit Ubuntu 10.04 // 32 Bit Java 1.7.0 [I think its XEN managed]

    --> So you can say its a "crappy" thing for Minecraft .... and yeah i change in a few days BUT i will use the same command line like today.

    --> And PLS dont try this stuff with the Java 1.6 Crap ..... there is a reason why everyone is waiting like hell for it :p ALSO, install it on Windows.
    Why ?? - Because if you play it on Windows you also need JAVA to run the game ;) So why give the Server the better JAVA and you use the Shitty slower performing JAVA ?!?! :p

    Yeah, JAVA 1.7.0 for everyone under:

    http://jdk7.java.net/download.html [Download the JDK-Version NOT JRE-Version for both CLIENT and SERVER]

    [Pls uninstall your old JAVA-Version if you dont know how to change the Versions under Windows AND if you have a 64 Bit OS just install the 64 Bit Version ..... Maybe your Browser or other things will need a 32 Bit JAVA 1.7.0, then you can install it also .....but MineCraft can use the 64 Bit Java and most APPS will use it also !

    RESULTS:
    1x Windows OS with a NEW 32 / 64 Bit JAVA 1.7.0 JDK

    1x Linux or Windows Server with a NEW 32 / 64 Bit JAVA 1.7.0 JDK
    [How to Install JAVA 1.7.0 under UBUNTU ?]

    1x Craftbukkit-0.0.1-SNAPSHOT.jar
    [Or similar Serversoftware (not tested atm) ... in the End its all JAVA]

    1x CommandLine to Start the Server

    java -server -Xincgc -Xmx2048M -Xms512M -Xmn256M -XX:NewRatio=2 -XX:CMSFullGCsBeforeCompaction=1 -XX:SoftRefLRUPolicyMSPerMB=2048 -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:+UseAdaptiveSizePolicy -XX:+DisableExplicitGC -Xnoclassgc -oss4M -ss4M -XX:+UseFastAccessorMethods -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseConcMarkSweepGC -XX:UseSSE=3 -XX:+UseCMSCompactAtFullCollection -XX:parallelGCThreads=2 -XX:+AggressiveOpts -cp "craftbukkit-0.0.1-SNAPSHOT.jar" -jar "craftbukkit-0.0.1-SNAPSHOT.jar" nogui

    [The Smiley means: -XX: P <-- all together pls]


    Questions ??:

    What is the Result of that long line ?

    - To hold your MEMORY for JAVA as long down and performant as possible, with the fastest method for the GarbageCollector. So you have only the STUFF which is needed in RAM and nothing else ! --> Performance !!!!! and no Lags ( or much much smaller :p ) !!!!!
    Test it with "dynmap fullrender world":

    - 1x run with standard command line = 560MB -> 900MB and getting higher (FIX: Server Restart)

    - 2x run with "my command line" = 560MB -> 621MB and its staying !! (I even rendered 4 Worlds at the same time! And had the same amount of memory !!)


    Why is the -Xms512M so low ?
    - Because its the "starting" Memory which can be used.... why should i give 2 GB from the start if the Memory wont get so full now ? And you have Xmx2048M which is the MAX ... so its dynamically filling.

    What is the -Xmn256M meaning ?
    - Java 1.7 has 2 Garbage Collectors. 1 OLD and 1 YOUNG and this means that the YOUNG Collector gets 256MB RAM. [Dont forget if you have 32 Bit OS that the memory -Xms and -Xmn are together for the RAM amount !! So you can only use 1,7GB for the APP.

    There are sooo many things i dont understand in your command line.... PLS tell me more
    - I will, but not atm :p i wanna give you a try first and await your feedback ! If it works like at my server, we can change it to a nice text ;)

    -- AND PLEASE MAKE A "BACKUP" of your STUFF / WORLD because i dont take any responsability what might happen to your world(s) ;)

    -- You can also "CHANGE" things in the CommandLine. If you do this, pls read the sentence above :p

    -- If you missed the sentence from above:

    -- PLEASE MAKE A "BACKUP" of your STUFF / WORLD because i dont take any responsability what might happen to your world(s) ;)

    -- And something for Notch :p --> "PLS change the CODEBASE to something other then JAVA" .... its atm manageble but i cant see a good and working future for the game, because you cant really do everything what you imagine .... and only because of the JAVA Restrictions and Performance Problems !!!



    And THX for the Game ;)

    seems like it works flawless :p

    UPDATES:

    http://forums.bukkit.org/threads/op...t-in-a-extreme-way-p-need-feedback-thx.25994/


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jan 8, 2016
  23. Offline

    Therawroy

    I see there is a real interest for this tweak .... so i am making a Video with some Benchmarks which will show you different configs in hardware / software and Java Configs with and without the special command line.

    In the end i will call it something like "SPITAKMarks" or "PerformaSPITAK" or "Javagra" :p

    Also there is an idea of making a small Linux from the scratch with the jdk 7 and everything tuned. So you start and enjoy ... and the name should be "SPITUX" ;)
     
  24. Offline

    ReKLiS

    Im using rtoolkit wrapper and im having problems setting up my server with ramdisk. My world isn't being saved after i restart the wrapper or turn it off.

    Wrapper im using
    http://forums.bukkit.org/threads/ad...-detection-auto-saves-remote-console-953.674/

    Here are my current settings

    rtoolkit.sh
    Code:
    USER=
    PASS=
    sudo chown -R usr:grp /opt/bukkit/proving_grounds
    cp -r backup/proving_grounds ./
    rm -r backup/
    mkdir backup/
    cp -r proving_grounds/ backup/
    
    ##YOU SHOULD NOT NEED TO EDIT ANYTHING BELOW THIS LINE##
    DIRECTORY=$(cd "`dirname "$0"`" && pwd)
    (cd "$DIRECTORY"; java -Xincgc -Xmx30M -XX:MaxPermSize=40M -jar Minecraft_RKit.jar ${USER}:${PASS})
     
  25. Offline

    Therawroy

    I got it more specialized ;)

    [FOR 32 BIT or vServers with 32 BIT ONLY !] UPDATED
    java -server -Xincgc -Xmx2048M -Xms512M -Xmn256M -XX:NewRatio=2 -XX:CMSFullGCsBeforeCompaction=1 -XX:SoftRefLRUPolicyMSPerMB=2048 -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:+UseAdaptiveSizePolicy -XX:+DisableExplicitGC -Xnoclassgc -oss4M -ss4M -XX:+UseFastAccessorMethods -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseConcMarkSweepGC -XX:UseSSE=4 -XX:+UseCMSCompactAtFullCollection -XX:parallelGCThreads=2 -XX:+AggressiveOpts -cp "craftbukkit-0.0.1-SNAPSHOT.jar" -jar "craftbukkit-0.0.1-SNAPSHOT.jar" nogui

    [The Smiley means: -XX: ParallelGCThreads <-- all together pls
    Dont forget the "P" instead of "p"]

    [FOR 64 BIT Servers !] UPDATED
    java -native -server -Xincgc -Xmx6144M -Xms2048M -Xmn512M -XX:NewRatio=2 -XX:+UseThreadPriorities -XX:CMSFullGCsBeforeCompaction=1 -XX:SoftRefLRUPolicyMSPerMB=2048 -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:+UseAdaptiveSizePolicy -XX:+DisableExplicitGC -Xnoclassgc -oss4M -ss4M -XX:+UseFastAccessorMethods -XX:CMSInitiatingOccupancyFraction=90 -XX:+UseConcMarkSweepGC -XX:UseSSE=4 -XX:+UseCMSCompactAtFullCollection -XX:parallelGCThreads=4 -XX:+AggressiveOpts -cp "craftbukkit-0.0.1-SNAPSHOT.jar" -jar "craftbukkit-0.0.1-SNAPSHOT.jar" nogui

    [The Smiley means: -XX: ParallelGCThreads <-- all together pls
    Dont forget the "P" instead of "p"]

    [FOR 64 BIT Servers with Problems !] UPDATED
    java -server -Xincgc -Xmx6144M -Xms2048M -Xmn512M -XX:NewRatio=2 -XX:CMSFullGCsBeforeCompaction=1 -XX:SoftRefLRUPolicyMSPerMB=2048 -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:+UseAdaptiveSizePolicy -XX:+DisableExplicitGC -Xnoclassgc -oss4M -ss4M -XX:+UseFastAccessorMethods -XX:CMSInitiatingOccupancyFraction=90 -XX:+UseConcMarkSweepGC -XX:UseSSE=4 -XX:+UseCMSCompactAtFullCollection -XX:parallelGCThreads=4 -XX:+AggressiveOpts -cp "craftbukkit-0.0.1-SNAPSHOT.jar" -jar "craftbukkit-0.0.1-SNAPSHOT.jar" nogui

    [The Smiley means: -XX: ParallelGCThreads <-- all together pls
    Dont forget the "P" instead of "p"]
    [NOTICE ON THINGS YOU CAN OPTIMIZE]
    -Xmx6144M - The Maximum Amount of RAM you have

    -Xms2048M - The Minimum which the Minecraftserver starts with

    -Xmn512M - NewGarbage Collector Size (dont set too high)

    -XX:UseSSE=4 - Which SSE you use. Maybe you need to set it to "3"

    XX:parallelGCThreads=4 - Set the number to the same amount of Cores in your Server

    Tested with CB #1000

    [​IMG]

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jan 8, 2016
  26. Offline

    Mhalkyer

    @TnT Thanks for the awesome thread, I've learned a lot. A few questions/comments though:

    1. Does using RAMDISK still speed up the server significantly since the new map format?

    2. Would you please add the java param explanations and a link to Therawroy's Java 1.7 tweaks to the OP ?

    3. I'm running a x64 Linux server on a 3.5GB VPS (map size ~3k x 3k). I usually allocate 2.5GB to the server with this script:
    Code:
    java -server -Xms2560M -Xmx2560M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=16 -XX:+AggressiveOpts -jar craftbukkit.jar nogui
    after reading this thread I'm going to try this:
    Code:
    java -d64 -Xincgc -Xmx2560M -XX:+CMSIncrementalPacing -XX:+AggressiveOpts -jar craftbukkit.jar nogui
    Any tips or comments? I removed the '-server' param since I've heard mixed things about it. I'm also having a memory leak which I can't seem to track down.
     
  27. Offline

    Therawroy

    do you have Java 1.7.0 ? and the -d64 shouldtn be necessary

    try "-native" instead of -d64 and -server ---- but normally you should set "-server" also :p


    I will write a little guide soon which shows you some tricks, what you can also optimize, beside the command line. Also i will tell more what most of the comnmands mean.
    For me its important to hear from your experience without trying to optimize it by yourself ;)

    The Guide will include things like:
    - Java Priority change
    - Priority change
    - Command line explanation
    - some small Java Tweaks ;)
    ......​
     
  28. Offline

    TnT Retired Staff

    Honestly, I haven't done very much testing non RAMDISK vs RAMDISK worlds after the new format. However, I'm sure it still helps. I end up running smaller worlds just off the disk myself now (aka, nether) but those worlds always stay small.

    Read up here to know more. The thing is, you'll get told to use a bunch of different options by a bunch of different people who don't explain why you should use them, or what they do. Most of those options do not seem to have much effect on servers with a max heap under 10GB, from my experience.

    For example: -XX:parallelGCThreads=16 means that you will use 16 threads for Garbage Collection (GC). Did you know that it will, by default, use as many threads as you have CPU cores? Its actually used to decrease the amount of threads given to your GC process since servers with a lot of cores will automatically use a lot of threads, which is undesirable. Its better to have a lower number there instead of a higher number. It has nothing to do with the amount of threads your Java process uses.
    Example 2: -server is used when you want to explicitly tell Java to use the server version of the package. If you are running a server OS, it is on by default.
    -Xincgc, -XX: +UseParallelGC, -XX: +UseConcMarkSweepGC, and -XX: +UseParNewGC are all GC options. Usually they should not be mixed and matched - use one or the other. Most of the times, Incremental GC (-Xincgc) is pretty good at keeping RAM usage lower while not sacrificing performance. Keep in mind, different GC methods are best used for different server sizes. Read here for some exhausting documentation on GC.

    For your option: -XX: CMSIncrementalPacing, I highly suggest you open this page up, search for CMSIncrementalPacing, and read. I don't see a reason why you would need it. AggressiveOps may or may not be useful, test with both. Java 1.7 includes that by default, afaik.
     
  29. Offline

    Mhalkyer

    WOW! Thanks for the detailed response. I'm going to disable Incremental Pacing (-XX: CMSIncrementalPacing) for now. I also added Java 1.7 and it's working loads better =)
     
  30. Offline

    Therawroy

    TnT: Thats the reason why i dont wanna comment most of the commands, because there are many different things .... but i test it myself and you can also measure the things which happens in Java. So in the end i try to pick the best of both worlds. I see at my own server the positive results ... and most of you have a much much better Server then me ;)

    but at some points your right .... If you have a QuadCore with HyperThreading (8 Cores) ... i wouldnt use more then a maximum of 4 ! ---- but yeah ... you all would try more ;) .... me too :p

    So in the end i have a Feedback from 15 People and only 1 sees no difference ....
     
Thread Status:
Not open for further replies.

Share This Page