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

    user7

    Does
    Code:
    # mount -a
    give you the same error msg?

    Code:
    $ df -h 
    should verify it mounted correctly.
     
  2. Offline

    mindless728

    oh i agree, just most people when they say i am getting an SSD it is an MLC drive as the SLC drives are usually fairly expensive unless you find a good deal

    personally i haven't had any problems with my mechanical drives, just my internet slowing me down
     
  3. Offline

    RchGrav

    I also found this PDF comparison of Windows RAMDISK benchmarks...
    http://fiehnlab.ucdavis.edu/staff/kind/Collector/Benchmark/RamDisk/ramdisk-benchmarks.pdf

    After looking it over I think I would check out QSoft RAMDisk if I was going that way... it is one of the less expensive commercial products, is available in 32/64bit flavors, is able to reload an image into the ramdisk at boot time and then save it on shutdown, and also is the fastest of the bunch.

    Regardless of the auto load and save you will ABSOLUTELY want to set up some kind of automatic backup to your physical drive.

    Also.. depending on how you do your world backups you may want to check out a few of these utilities for creating file system junctions in Windows....
    http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx or http://www.pearlmagik.com/winbolic/

    The second program called "WinbolicLink" is a GUI app, the latest version is from 2003, but don't worry, it works wonderfully even on newer versions of windows. (Right click, Run as Administrator) I have tested it on Windows 7 64bit to create NTFS junction points from a path on one drive to a path on another. Its 100% transparent, so you could create a backup folder on your ram drive that links over to a location on a physical drive.

    Hope this info helps!

    Rich
     
  4. Offline

    Brettflan

    It you're running a Linux VPS, ramdisk functionality may be disabled. I'm using a RAM VPS plan with 123Systems which apparently runs on OpenVZ, and I'm told ramdisk is disabled in OpenVZ (my testing confirmed it for this account, anyway).
    Instead, I'm currently trying tmpfs instead, since it seems to work on OpenVZ. The potential disadvantages compared to ramdisk is that tmpfs is set at a fixed size and will give errors if you try to overfill it, and tmpfs can potentially go into swap memory (which would defeat the purpose, swap being written to HD). It otherwise functions basically the same as ramdisk, being lost on reboot and so forth.

    Here's an example command for mounting a tmpfs path:
    mount -t tmpfs -o size=300m tmpfs /minecraft/world
    That will mount a 300 MB section of memory to the file path "/minecraft/world".

    I've only tested it out for a short while so far, but initial results are promising.
     
  5. Offline

    TnT

    Edit: Updated typo in my ramdisk setup.
    Code:
    Proper line: ramdisk /opt/minecraft/craftbukkit/world tmpfs mode=1777,size=512m
    old line: ramdisk /opt/minecraft/craftbukkit/world tmpfs mode 1777,size=512m
    Need that mode=1777
     
  6. Offline

    croxis

    Why ramdisk instead of tmpfs?
     
  7. Offline

    TnT

    I wish I had a good technical answer for this, but I believe the way the kernel handles the files work better using ramdisk than tmpfs. As the one post by Brettflan said, it works as well.
     
  8. Offline

    croxis

    I've been looking far articles to see how of difference between ramdisk and tmpfs. I found an article suggesting altering swappyness parameter at boottime, which is useful for people who might not have copious amounts of ram. This is also useful as tmpfs may also page to swap. While I have not found articles with benchmarks, it seems people are reporting that, as long as it is not being swapped out, tmpfs is faster than ramdisk.

    I would wager that the best thing to do would be conduct real world and some sort of simulated minecraft benchmark for ramdisk/tmpfs speeds. My hunch is that the speed differences wont be significant (significant being noticeable to the end user, about 10ms or greater). If both are close enough then tmpfs has the advantage of dynamically scaling, so it will only use as much ram as needed.
     
  9. Offline

    fffizzz

    I was using tmpfs as a ramdisk prior to reading this guide. Unfortunately, centos, doesnt have a ramdisk command. I followed this guide.
    http://crazytoon.com/2007/06/01/ram...et-up-ramdisk-under-linux-centos-rhel-fedora/

    Thinks its more or less the same thing? I didnt have any kernel commands passing from grub previously either, ill monitor performance.

    Now when you run a ramdisk, do you run your whole /minecraft/* or just your world/ folder out of it?i have 12 gigs of ram, so i have plenty, right now my world is only 156 megs since we recently restarted.
     
  10. Offline

    causs

    I have no problem with RAM. It's around 60%. But my CPU is going insane. With 3 peeps on my server, it goes 100%.

    It is a dual core 2,4. So not sure what to do.
     
  11. Offline

    fffizzz

    wow wow wow.. Ill have to see during peak hours, but disabled swap, changed from tmpfs to ramdisk, and my cpu hasnt been this low in a while!
     
  12. Offline

    TnT

    @croxis I think at that point we're really splitting hairs. If you want to do those tests, I'd be interested in seeing the result.

    @fffizzz Looks pretty much the same to me. I put just my world folder in the ramdisk. However, if you really have a lot of space to spare, throw your whole Minecraft dir into it. In doing that you'll speed up access to the flat files, or sqlite files in that same directory. This will improve performance, but I think it will be negligible at best. The most important part is running constant backups.

    @causs
    Fire up a new thread, and fill out this information. We'll try to help.
    --- merged: Jan 28, 2011 3:43 PM ---
    F-ing eh man. Good to hear.
     
  13. Offline

    user7

    tmps is also stored in ram, however it is dynamically generated and less paged files are moved to swap. While ramdisk will run entirely in memory. tmps can also be resized on the fly.
     
  14. Offline

    TnT

    You work on Linux/Unix servers a hell of a lot more than I do. The question has been posed above - what's better? What's your take on it?
     
  15. Offline

    lawina

    I have a vps hybrid server with 32GB memory, 1 gbps connection and 10 cpu cores. I run a few low traffic sites and only 1 MC server. CPU usage and memory usage never gets high (6GB ram allocated for MC), but I still have occasional lag spikes with just around 20 players on. I think it's a problem with the disk/IO. What's the best way to test the drive speed? (besides using the "hdparm" command, as hdparm -t /dev/vzfs gives me "Permission Denied")
     
  16. Offline

    croxis

    @TnT @user7 I just ran a benchmark test and, assuming my methods and statistics are right, no significant performance difference between the two. I plan on doing one on my lower memory vps in a bit.
     
  17. Offline

    user7

    In theory I would say ramdisk, since it's not going to touch swap (assuming your swap is on a physical disk) at all. However with modern hardware and OS's I doubt you are going notice a difference.
     
  18. Offline

    TnT

    @user7
    That was what I figured.
    @croxis
    Thanks for settling that debate.
     
  19. Offline

    fffizzz

    This is with 20 people connected.
    machine is dual/dual core 2.2 xeon procs
    5 gig allocated to minecraft
    ramdisk for world data

     
  20. Offline

    Bacu

    Using the backup script. After stopping server.

    Code:
    mv: cannot move 'world/' to 'backup/world': Device or resource busy


    Do I need to dismount before I can copy, or what?

    Rebooted, now the directory is invisible. How exactly was this supposed to work when the directory dissapears?
     
  21. Offline

    TnT

    If the directory is in the ramdisk, and you reboot, obviously the directory gets emptied, as everything in the RAM gets emptied upon reboot. The mv command was meant to run once the minecraft server shuts down, but you could use cp instead and run it while the server is running. If the server is shut down properly, and nothing is accessing the "world" or "backup/world" directories, you should not get those "Device or resource busy" messages.

    Did you put just your world into the ramdisk, or the entire Minecraft directory? Did you have anything accessing the world or backup/world directory at that time?
     
  22. Offline

    Bacu

    only put the world/ directory in ramdisk. I don't think there would be anything else using it, the server is the only thing running there.
     
  23. Offline

    TnT

    Try using cp instead of mv. But verify it works before rebooting.
     
  24. Offline

    user7

    Code:
    $ lsof |grep -i world
    Replace world with the path you are trying to move. Will then show you what pid is using that file.
    Another couple things to try.
    • make sure you are not in that directory you are trying to move. So cd /
    • make sure you are using absolute paths. The example you are giving above indicates backup is within world, so moving the upper directory to a lower one doesn't make sense.
     
  25. Offline

    Bacu

    Started from the begining and changed that. Seems to work well enough.. I'll see if it screws anything up in the future.
     
  26. Offline

    craftopia.net

    We just picked up a new HDD for our server, its a WD Caviar Black SATA300 with 32mb cache.
    When formatting for the server, are there any tips on setting Allocated Unit size or anything that would boost performance?? As it is, we are running Win7 64bit with 3gigs of ram (next to be upgraded) and the current IDE drive shows our world as 244mb, but on disk is 600mb. I'd like to try to eliminate that problem when we install our new Drive.

    Also, is there a noticeable performance increase on the server-side when upgrading from a Windows based OS to Linux?

    Thanks in Advance!
     
  27. Offline

    TnT

    @craftopia.net
    You could try allocating smaller sectors (4k) for your HD. Although the point is probably moot as Mojang will be changing up how world data is stored soon.
     
  28. Offline

    desmin88

    TnT, you could also some more add arguments that tune the java process. Take a look at my bat config.

    @echo off
    "%ProgramFiles%\Java\jre6\bin\java.exe" -server -Xincgc -Xmx2048M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:parallelGCThreads=2 -XX:+AggressiveOpts -jar craftbukkit-0.0.1-SNAPSHOT.jar

    As you can see, I have some arguments to tune my server to squeeze performance out of it.

    I don't know if I really should be running three garbage collections, but it seems fine so far, and the other arguments really do help. -server also helps by running a optimized server form of Java.
     
  29. Offline

    ledhead900

    IM never buying an SSD not while there working how they do currently pff small writes kill them fast.

    Pathetic and im not paying $160 - $400 for storage space that is going to shit bricks when u actually want to use its speed for something other then an OS hell even an OS I dont trust on an SSD I rather be running raid 0 with 4 drives or even 2.

    Or just run raid 5, imo if your working with small files you don't need an SSD a simple raid 0 setup will easily give u the boost your need. provided your drives are already fast.
     
  30. Offline

    Plague

    Wow, this reminds me of those ricers on gentoo that do this to CFLAGS and then have way too many problems to solve it any other way than reformatting ;)

    I would bet my soul that you never did any comparative testing other than "it feels better"-sort ;)

    Minecraft is slow because it is written quite badly and Mojang haven't gotten to optimizing it yet. So although this could bring a tiny-little gain, in the long run it's just a bad burden because of maintainability and stability.
     
Thread Status:
Not open for further replies.

Share This Page