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

    desmin88

    @Plague

    Thats kind'ave funny, because many other server hosters use the same arguments as I.
    Care to elaborate on "maintainability and stability"? because as of right now, that is one of the most vague posts
    I've ever seen.
     
  2. Offline

    vapid2323

    RAMDisk really helped my server, I have been running that way for about 1 month. Granted I have 24GB of ram
     
  3. Offline

    Plague

    You mean like studying each and every switch you used there? No :)
    I just meant, that although those switches can increase the performance a little, i bet you even don't know what they do either, and so the maintainability is gone, because u use something you know squat about.
    And also that from experience, so many unknown arguments without a testing on the target machine actually have a worse result than using a default configuration.
     
  4. Offline

    TnT Retired Staff

    It works for servers both large and small, as long as you have a little ram to spare (or if your world is small enough).
     
  5. Offline

    desmin88

    I never said they study every switch, so I dont see how you would think that.
    Also, why would take the automatic assumption that I don't know what the switches do/mean?
    No 'worse' result on my server. It runs with less ram usage, less lag, and overall better performance, compared to a bukkit server with none of the switches, default set up.
     
  6. Offline

    TnT Retired Staff

    I've seen the -server argument cause people problems. I haven't ran into issues with my setup the way it is, but perhaps I'll give that flag a try.

    Code:
    -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=2 -XX:+AggressiveOpts
    What do those arguments do, exactly? Before I run anything, and definitely before I endorse anything, I like to have an idea what they do, and why they are needed beyond the simple garbage collection -Xincgc flag?
     
  7. Offline

    desmin88

  8. Offline

    TnT Retired Staff


    It would have been pretty easy to cut and paste from there. Here, I'll do it for you.

    Code:
    -XX:+UseConcMarkSweepGC -XX:+UseParNewGC

    Selects the Concurrent Mark Sweep collector. This collector may deliver better response time properties for the application (i.e., low application pause time). It is a parallel and mostly-concurrent collector and and can be a good match for the threading ability of an large multi-processor systems.
    Perhaps for if you are running large multi-processor systems this would be a benefit. As well, for GC we already have the -Xincgc flag. For the average user, I don't see this adding much benefit over the current flag. Probably will induce confusion though.

    Code:
    -XX:+CMSIncrementalPacing

    Either my search sucks, or I couldn't find anything on this flag in that document.

    Code:
    -XX:ParallelGCThreads=20


    This allows you to set how many threads go to work for garbage collection (equal to the number of cores you have). I could see someone setting this flag on a system with a great many cores (many large, multiprocessor servers for example), but you wouldn't see any significant improvement on anything less than 10 CPU cores, and only if you notice your CPU is always maxed out. My server gets 2 cores: no point for me.

    Code:
    -XX:+AggressiveOpts


    It will be turned on by default in the next release, when it's ready. I'm going to avoid running experimental java commands with bleeding edge software. Decreases the chance of my Java being the cause of my problems.
     
  9. Offline

    desmin88

    Well, I run those flags and have no problems, so far Java isn't causing any problems for me and running better before. Also, thanks for cutting and pasting for me! [​IMG]
     
  10. Offline

    TnT Retired Staff

    As is mine with my current commands. :)
     
  11. Offline

    Plague

    Code:
    -XX:parallelGCThreads=20
    That was my point when i posted about "ricing". 20 threads are just a stupidity even on 8 core computer.
     
  12. Offline

    TnT Retired Staff

    Without that command, Java will give you the same amount of threads as you have cores for the process. So on an 8 core machine, you will be given 8 GC threads. The flag is actually there so people can DECREASE the amount of threads they allocate for GC, not increase it.

    Its not even ricing, its like trying to put semi tires on a street racing car because it looks cool, even though it destroys the cars performance.
     
  13. Offline

    desmin88

    Thats funny Plague. Lets take a ponder at my original post in the thread.
    I reduced the threads. The =20 comes from the link I posted. Not ricing at all my friend.
     
  14. Offline

    TnT Retired Staff

    Why wouldn't you reduce the number of threads to 1?
     
  15. Offline

    desmin88

    Never thought about it really. Guess I could try it.
     
  16. Offline

    Nate204

    So...
    I'm going to pull my hair out...or what's left of it.

    Today I bumped my server RAM up to 5GB.
    I'm almost positive that I'm running a 32bit version of Java SDK. I must be, because of the error I'll show below.
    I DO NOT want to limit java to running at 1GB -.-; I use the server ONLY for Minecraft.

    SO I tried the following command, and This is what I get.
    (I'm using a funky command right now~ due to BigBrother not functioning like it should.)

    I'll get an error saying something about the size exceding the the allowed amount for Java. It will then tell me "Could not create the Java virtual machine."

    I post this here, because I tried to edit the restarter config, and It wouldn't work correctly.
    The server would still show as using only 1gb of RAM. I figured it "was" the restarter, until I tried to run it as Minecraft.net suggests.

    I'm trying to allocate 4gb of my 5gb.

    Does anyone know what could be wrong?
    I'm using Ubuntu 10.10 with 2x Xion 2.8 Duo Core
    I had it unlocked to allow for the use of more than 4GB of memory.

    (see suggestion below)
    http://ubuntuforums.org/showthread.php?p=10453928#post10453928

    Thanks everyone who can assist with this odd ball question~
     
  17. Offline

    TnT Retired Staff

    Honestly, it looks like you're running a 32 bit OS. Can you please do a uname -a for me?

    I'm running x64 Ubuntu 10.10. You should see an output similar to this:
    Code:
    Linux <computer name> 2.6.35-25-server #44-Ubuntu SMP Fri Jan 21 19:09:14 UTC 2011 x86_64 GNU/Linux
     
  18. Offline

    Nate204

    Linux Server 2.6.35-25-generic-pae #44-Ubuntu SMP Fri Jan 21 19:01:46 UTC 2011 i686 GNU/Linux
     
  19. Offline

    TnT Retired Staff

    You are running Ubuntu 10.10 x86 edition.

    I'll state the obvious in case you are unaware, x64 software will not run on x86 OS's. x86 Java has a 1.5 GB RAM limit.

    On the very top of this post, I pasted instructions for Ubuntu x64 in case you need it.
     
  20. Offline

    Nate204

    So a 32 bit server running JDK can only read 1.5 GB of RAM?
    How upsetting.... Could you give me a source? I'm not disagreeing with you at all, I would just like to learn more. I swear I learn something new about Java, Linux, and servers every day....

    I appreciate the info, I really do. I have an open topic now with the Ubuntu forums just to gather more info.
    http://ubuntuforums.org/showthread.php?p=10458983#post10458983
    --- merged: Feb 14, 2011 11:44 PM ---
    Or maybe another question too.

    If you found yourself in my shoes, what would you attempt to do? Just thought I would ask, considering I'm all out of Ideas =) lol
     
  21. Offline

    croxis

    This is true for any 32 bit application, which is limited to about 2 gigs of memory.

    My suggestion is to backup, reformat, and install a 64 bit version of the os.
     
  22. Offline

    TnT Retired Staff

    I should clarify: You can only allocate a max of 1.5 G to your Java heap. (The -Xms and -Xmx flags).

    A source of my reasoning why you're running x86, not x64?
    My first and only needed clue was this line:
    Code:
    Kernel and CPU	Linux 2.6.35-25-generic-pae on i686
    You do not need pae on a 64 bit OS. No need. PAE is only to allow 32 bit OS's to use more than 4 GB of RAM. Second part of that is where it says i686, which means x86 architecture.

    According to that, your processor is too old to contain the x64 instruction set.

    You can still run Craftbukkit a-ok. Just use this as your command line:

    Code:
    java -Xincgc -Xmx1536M -jar craftbukkit.jar nogui
    You just can't allocate more RAM to the Java process.

    All is far from lost though. You have 5 GB RAM, so you can still use a ramdisk, and a rather large one at that.
    --- merged: Feb 15, 2011 12:14 AM ---
    You could also get pretty clever with a plugin like ServerPort. Since you have 5 GB RAM, you could run multiple Java processes (aka, multiple craftbukkit servers), each using 1.5 GB RAM, and link them all together. Use a plugin like borderguard to limit the world size, and throw each world folder into their own ramdisks.

    Or if you want to spend money you could upgrade CPU/mobo/RAM.
     
  23. Offline

    Toasty

    Because iirc bukkit is still single threaded (correct me if I'm wrong. Infact, I'd like that a lot, because I want multithreading :O). Therefore (assuming bukkit is single threaded) there's no reason to give bukkit more than one thread.
     
  24. Offline

    mutiny

    Garbage collection is a seperate thread, which is what he was referring to, 1 gc thread
     
  25. Offline

    fffizzz

    When i had to update ram on my server, and struggled to find out why i couldnt allocate more than 2GB, i realized I was running 32bit centos. You just have to take the plunge, make a complete backup of anything important and make an afternoon out of it and redo the system.
     
  26. Offline

    Nate204

    I would love to do that, but my CPUs can only read 32bit.

    As for the RAMdisc, Hwo do I know if it's working?
    I made a script like you said, but I saw two quick errors fly bye at the start~ but then the server does start up anyway. I see a file called backup in my directory now.

    What should I be looking for?
     
  27. Offline

    TnT Retired Staff

    Run the command
    Code:
    df -h
    You'll see a ramdisk if you've added one, and where its mounted.
     
  28. Offline

    Nate204


    nate@Server:~$ df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/md0 129G 48G 75G 39% /
    none 2.5G 192K 2.5G 1% /dev
    none 2.5G 0 2.5G 0% /dev/shm
    none 2.5G 48K 2.5G 1% /var/run
    none 2.5G 0 2.5G 0% /var/lock

    ramdisk 1.0G 496M 529M 49% /home/onlineself/midworld

    none 129G 48G 75G 39% /var/lib/ureadahead/debugfs
    /dev/sda3 1.3G 106M 1.1G 9% /boot
    nate@Server:~$

    =D
    Thanks for everything! Even though the RAM think kind of flipped my day upside down, this helped!
     
  29. Offline

    Daveyo

    this post was extremely useful
     
  30. Offline

    Toasty

    Yes, I realize that. Hence why I said you should only give bukkit one thread, and leave the rest for gc.
     
Thread Status:
Not open for further replies.

Share This Page