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


    Ladys, i got my new server ... no vServer and Power like a Beast ... and enough RAM :p

    And to get some heat away from the thread, i can understand now why people with Big Servers dont see that much difference ... you can notice some things and also measure it, but its a huge difference from my vServer.

    In the end ... if you got the Power and Ram, you probably dont need most of the stuff in the command line ..... but if you have a real poor server and low memory ..... my command line is the way to go =) [Until you got a new Server]

    Thx for all your Feedback ... even if you tried to be mean to me :p And Sorry for my english ... i am german ;)

    And for now, my last command line .... specially optimized for ya and almost BETA Status :p Thx to VMWare and the abilities it gave me to test the stuff directly.

    -- And if you dont know what comes now .... here again ..... BACKUP YOUR WORLD !!!

    - Orange commands can be changed or removed (if needed)

    [64 Bit Optimized for pure Satisfaction]

    java -native -server -Xincgc -Xmx6144M -Xms2048M -Xmn512M -XX:NewRatio=3 -Xrs -XX:+UseThreadPriorities -XX:CMSFullGCsBeforeCompaction=1 -XX:SoftRefLRUPolicyMSPerMB=2048 -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:+UseAdaptiveSizePolicy -XX:+DisableExplicitGC -Xnoclassgc -oss4M -ss4M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseConcMarkSweepGC -XX:UseSSE=4 -XX:+UseCMSCompactAtFullCollection -XX:ParallelGCThreads=4 -Xcheck:jni -XX:+AggressiveOpts -cp "craftbukkit-0.0.1-SNAPSHOT.jar" -jar "craftbukkit-0.0.1-SNAPSHOT.jar" nogui

    [32 Bit Optimized for the future !!!]

    java -native -server -Xincgc -Xmx2048M -Xms512M -Xmn256M -XX:NewRatio=2 -Xrs -XX:+UseThreadPriorities -XX:CMSFullGCsBeforeCompaction=1 -XX:SoftRefLRUPolicyMSPerMB=1024 -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:+UseAdaptiveSizePolicy -XX:+DisableExplicitGC -Xnoclassgc -oss4M -ss4M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=90 -XX:+UseConcMarkSweepGC -XX:UseSSE=4 -XX:+UseCMSCompactAtFullCollection -XX:ParallelGCThreads=2 -Xcheck:jni -XX:+AggressiveOpts -cp "craftbukkit-0.0.1-SNAPSHOT.jar" -jar "craftbukkit-0.0.1-SNAPSHOT.jar" nogui

    - And did you see ??? I got a fix for the smiley problem :p
  2. Offline


    My map is 2.5GB and often I have issues with blocks respawning. Would this be a issue with the HD being slow? Would a ramdisk help a lot? I have really been thinking about buying more ram just so I can use a ramdisk, hoping it fixes my problem. Suggestions?
  3. Offline


    Another way is to improve performance is deleting some *useless* plugins.
  4. Offline


    question about the esxi vm: does it run the serer for u like its dedicated? orr does it replace ur cpu as the host? im confused about the whol thin i evem looked at the website and still dnt get it
  5. Hi ! :) Thanks alot for the ideas here.. When I try to use the command line that therawoy has written, i get:" Java Virtual Machine couldnt be created", or something like that.. So for now I only use this:

    SET BINDIR=%~dp0
    CD /D "%BINDIR%"
    "E:\Program Files\Java\jre7\bin\java.exe" -Xincgc -Xmx10240M -Xms2048M -Xmn512M -cp "craftbukkit-0.0.1-SNAPSHOT.jar" -jar "craftbukkit-0.0.1-SNAPSHOT.jar" nogui
    My server has double intel XEON processors, 16GB RAM, and Windows Server 2008.. But it still gives me trouble about the performance when I have 10-15 players on it.. :/

  6. Offline


    I will point out the 3 major issues in order of what is prob worse on a new map.
    1) Chunk Generating
    2) Chunks Loading / Unloading
    3) Windows :p

    The nice part is 2 and 3 are easily solved.

    SSD, Ramdisk, Raid 0

    3 you move to linux proven over and over again in many benchmarks to be faster.

    1) also can be solved by finding a plugin that renders map out to a certain distance then use borderguard to prevent people exploring further.
  7. Alright..

    I fixed the RAMDisk with a 3rd party application for windows called "Dataram RAMDisk".

    I thought it worked like a charm.. At first there was no errors with it, i made sure to back the worlds up to a seperated location every 45 minutes, and to back up everything from the RAMDisk twice a day.. It did improve on performance quite a bit, rendering almost no lag when /home'ing or warping..

    BUT, what I did get was a Read/Write error.. That occured once in a while.. It happened while I was online and stalled the server for about a minute, but when I was gone it happened from around 6pm and was still happening when I got back at 8.30 pm.

    I would rather want a bit of lag than no one being able to play the server at all.. So now I am back to scratch ! :/

    I also noticed I wrote that I had 16 GB og ram.. that is unfortunately not true, I only have 12GB..

    I think what I have to do now, is to fix up a HDD with some sort of Linux, and then prepare it, and just swap it out with the servers main HDD, quickly.. From there the RAMdisk within Linux might work better.. But I have no experience with Linux so Im really not sure..

    Can anybody recommend a linux version for this type of setup?


  8. Offline


    for ease of administration and use, use Ubuntu Server. You can google about any question you may have as its one of the more widely used dirtos.
  9. Offline


  10. Offline


    i switched to my current start line and havnt seen those cant keep up messages in almost a month where I used to be plagued with them!
  11. Alright guys.. A little update here..

    I changed my OS to ubuntu server using the guide provided by TnT ! (Thank you kindly)

    I fixed it so that the startline is this:
    java -native -server -Xincgc -Xmx10240M -Xms4G -Xmn512M -XX:NewRatio=3 -Xrs -XX:+UseThreadPriorities -XX:CMSFullGCsBeforeCompaction=1 -XX:SoftRefLRUPolicyMSPerMB=2048 -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:+UseAdaptiveSizePolicy -XX:+DisableExplicitGC -Xnoclassgc -oss4M -ss4M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseConcMarkSweepGC -XX:UseSSE=4 -XX:+UseCMSCompactAtFullCollection -XX:ParallelGCThreads=4 -Xcheck:jni -XX:+AggressiveOpts -cp "craftbukkit.jar" -jar "craftbukkit.jar" nogui
    But now.. I GET EVEN MORE of those annoying "Server cant keep up" messages.. What the H¨.. am I doing wrong here?

    I will try to change the startline to the one provided by mrvertigo and hope that it helps out !

    Also, i tried, but couldnt get the ramdisk to work.. :/

  12. Offline


    What kind of processor do you have?
    My old server was a Xeon 3GHZ (however, it was pentium 4 class(dellpoweredge 2850)) and would ge tthose messsage ALL the time.

    my new server, quad core, i5 2500k, never see those except during saves or if something happens and a restart is needed.
  13. Aw well thats probably the reason then.. Its a Dell PowerEdge SC1425.. :/
  14. Offline


    Our server is 1 week old and is getting this error also:
    [WARNING] Can't keep up! Did the system time change, or is the server overloaded?
    If more then 30 people are on the server then we are getting this warning, i am not sure if its real lag but if you look at the moon/stars then you will see it jump backwards ingame.
    Server Specs: I7-2600 / 16GBDDR3 / RamDisk / 100Mbit / Windows 2008R2
    Maybe i should overclock my cpu to see if it helps, but i dont like overclocking on a server.
  15. Offline


    No point in overclocking. Obviously something else is causing this. What plugins and bukkit ver?
  16. Offline


    Remove -Xincgc from your launch script.

    -Xincgc enables -XX:+UseConcMarkSweepGC and -XX:+CMSIncrementalMode (Under Java 6, under Java 5 it only enabled -XX:+UseConcMarkSweepGC which is probably why so many seem to think its a good idea)

    You've already enabled -XX:+UseConcMarkSweepGC and you don't particularly want to enable -XX:+CMSIncrementalMode as its designed for 1-2 CPU systems and small heap sizes. It reduces GC pause length on systems that don't have a spare CPU core around to handle the job and this comes at the expense of additional CPU overhead which can be rather significant with large heap sizes. It is specifically NOT recommended for use by Sun(Oracle) for system with 2+ cores and large heap sizes.

    You've also got a lot of options specified that are very load dependent, they very well may be hurting you much more than helping. More options most often does not mean better performance.

    Start simpler:


    Only play with all the other GC parameters once you have a stable setup and you can test their effect, they are highly load dependent.
  17. Offline


    So i also have the [WARNING] Can't keep up! Did the system time change, or is the server overloaded? and connot find out which plugin is causing this. Here is my start up as i am using a hoster service. Anyone see why this might be happening? I have 3gb of ram on the server with unlimited Harddrive space. When ever that error pops up the server lags as in everything around me stops working such as pick up an such and other players appear frozen as well as chat, then starts up again after a few seconds. This keeps happening every 20 secs or less. This would be my startup console.
  18. Offline


    Would this work for a computer *under* 1 gig xD?
    It's not really a computer, it's my PSP :3
    I do random crud when I'm board. Next thing you know, I'm trying to host a server on those cats that wave their paw.
  19. Offline


    Under 1 gig of what? RAM? Disk? 1GHz clock? Be specific.
  20. Offline


    After examining bukkit's file access behaviour, i have to say: running craftbukkit with tmpfs is a must.

     # inotifywatch -rv -t10 /var/minecraft
    Establishing watches...
    Setting up watch(es) on /var/minecraft
    OK, /var/minecraft is now being watched.
    Total of 568 watches.
    Finished establishing watches, now collecting statistics.
    Will listen for events for 10 seconds.
    total  access  modify  close_write  close_nowrite  open  moved_from  moved_to  create  delete  filename
    209    53      10      5            53             58    10          10        5       5       /var/minecraft/server/world_nether/
    203    51      10      5            51             56    10          10        5       5       /var/minecraft/server/world/
    188    0       188     0            0              0     0           0         0       0       /var/minecraft/server/world_nether/DIM-1/region/
    185    0       185     0            0              0     0           0         0       0       /var/minecraft/server/world/region/
    155    35      10      5            35             40    10          10        5       5       /var/minecraft/server/world_the_end/
    113    0       113     0            0              0     0           0         0       0       /var/minecraft/server/world_the_end/DIM1/region/
    That means, bukkit did 1053 file operations within 10 seconds.
    Thats like 1 operation in 10 ms.

    Even if counting just write operations we still get to 516 (without close write) that would still be one file operation in 20 ms.

    The question is: WHY?
    What does bukkit do to need 1-2 operations per 10 milliseconds.

    There are no plugins except xAuth, BukkitPermissions and VirtualChest.
    The map was reset.
    There are no players online.
    So where do these 1k file operations/10 seconds come from?

    So my suggestion is: get a 512M tmpfs. (if you need more, get more)
    tmpfs does only need the ram that is used up on a tmpfs, so you actually can go for a tmpfs with 100g with just 1g ram (which in some cases still makes sense)
    Just remember that ram + swap > tmpfs-size - as if tmpfs fills up, you wont get processes OOM-Kill'd.

    Also give up on changing jvm's gc behaviour - its mostly undocumented black magic that in most cases make stuff worse.
    Unless you know your OS *AND* know how your jvm version's gc(s) work, dont mess with it/them - it wont do you any good.
  21. Offline


    It doesn't. In fact, it isn't. I don't believe it's fair to blame Bukkit; this is something the vanilla Minecraft server is doing. Do the same test with a plain vanilla server, and I bet you'll see the same thing.

    No players online.
    total  access  modify  close_write  close_nowrite  open  moved_from  moved_to  create  delete  filename
    65     5       10      5            5              10    10          10        5       5       /var/opt/craftbukkit/ramworlds/world_the_end/
    65     5       10      5            5              10    10          10        5       5       /var/opt/craftbukkit/ramworlds/world/
    65     5       10      5            5              10    10          10        5       5       /var/opt/craftbukkit/ramworlds/owt3/
    65     5       10      5            5              10    10          10        5       5       /var/opt/craftbukkit/ramworlds/Survival/
    64     5       9       5            5              10    10          10        5       5       /var/opt/craftbukkit/ramworlds/world_nether/
    64     5       9       5            5              10    10          10        5       5       /var/opt/craftbukkit/ramworlds/sword2/
    64     5       9       5            5              10    10          10        5       5       /var/opt/craftbukkit/ramworlds/SnowPlains/
    64     5       9       5            5              10    10          10        5       5       /var/opt/craftbukkit/ramworlds/Lab/
    [INFO] Plugins: PortalStick, MobDisguise, CraftBookCircuits, Multiverse-Core, CraftBookCommon, MinecartRouting, CleanroomGenerator, Multiverse-SignPortals, SnowBallNextDoor, PermissionsBukkit, WorldEdit, Multiverse-Portals, WorldGuard, Multiverse-Adventure, CommandBook, Jail, dynmap, Dynmap-CommandBook, Dynmap-WorldGuard, BOSEconomy, HawkEye
  22. Offline


    have you tested it with recursive watchers?
    inotify or this tool works on per directory basis - test it yourself.
    so stats for /var/opt/craftbukkit/ramworlds/world_the_end/ do not include stats on /var/opt/craftbukkit/ramworlds/world_the_end/region

    i am running craftbukkit-1.0.1-R1.jar
    i have absolutely no plugins (moved plugindir away)
    and this are the current figures.

    minecraft@srv253 ~ % inotifywatch -rv -t10 server
    Establishing watches...
    Setting up watch(es) on server
    OK, server is now being watched.
    Total of 50 watches.
    Finished establishing watches, now collecting statistics.
    Will listen for events for 10 seconds.
    total  access  modify  close_write  close_nowrite  open  moved_from  moved_to  create  delete  filename
    329    0       329     0            0              0     0           0         0       0       server/world/region/
    329    93      10      5            93             98    10          10        5       5       server/world/
    191    47      10      5            47             52    10          10        5       5       server/world_nether/
    180    0       180     0            0              0     0           0         0       0       server/world_nether/DIM-1/region/
    101    17      10      5            17             22    10          10        5       5       server/world_the_end/
    47     0       47      0            0              0     0           0         0       0       server/world_the_end/DIM1/region/
    Again noone online & server unreachable.
    Also tiny maps:

    minecraft@srv253 ~ % du -sch server/world*
    3.9M    server/world
    3.6M    server/world_nether
    11M     server/world_old
    5.5M    server/world_the_end
    24M     total
  23. Offline


    I noticed my results where not the same (no recursive watches) - i ran it with the same flags that you did (-rv -t10) - how do i change that to get recursive watches?

    Also - my main point is that I'm sure vanilla has more or less the same behavior when it comes to worlds; it's well known that a minecraft server hits the disk a hell of a lot. It's not usually too bad on an HD, but an SSD could get fried out fairly quickly by it... I am running a tmpfs (could that affect my inotifywatch readings as well> I wouldn't think so, a write is a write...) because performance even with a few users on is an order of magnitude better on my system with it.
  24. Offline


    -r == recursive.

    im gonna change to tmpfs and post inotify stats later, but it should not change the output...
  25. I have a question: how many players should a dedicated i7 950 with 12gb Ram be able to run on average? (assuming datacenter hosted and a light-weight bukkit without a lot cpu-hogging plugins)
  26. Offline


    What kind of bandwidth? You'll be able to host at least 50 assuming there are not bandwidth limitations, possibly more.
  27. Offline


    Hi sorry but here's some noobish questions but i run a server on windows atm but have built another to try improve on what i have, so from a linux virgin :D (new to programming in general lol) i am after trying to max the performance from the equipment i have.
    Its a dedicated server with quad core & 64gb ssd, 250gb hdd with 8gb ram (soon 16), i'm worried about the writes to ssd from what i have read if i understand right that putting the whole server onto ram will help reduce the wear and also speed up the sqlite db's etc. What about the mysql db? would that wear the ssd fast too and could that also be ran of the ramdisk with a back up set in place to help reduce wear (if a problem) and also speed it up? As this is dedicated to running only minecraft with 60 plus plugins, including webserver for related mc features if there's extra to be gained i would prefer to follow that route.
    I also would like to know if it's possible to place java itself onto the ram and if that would make any difference.
    Would i be better off also sticking the os etc onto ssd then the minecraft folder (and mysql if could go on ram?) onto hdd as wouldnt make a difference to the speed compared to an ssd if it runs from ram (is that right?) it would just take a little longer to load to ram ? lol then the writes wouldn't effect the ssd at all as would write back to hdd and i would have the benifit of running the os itself from the ssd?
    I'm running unbuntu server because from all the forums and documentation i have read through it seams to be the most recommended.
    Any help would greatly be appreciated as would any links with easy to follow tuts. i am still very fuzzy on all whats been talked about although it's sinking in the old brain gradually :D
  28. Offline


    I'd suggest installing your OS and any data drives on your SSD's - this gives your OS the speed advantages of your SSD, which would be great to have. On top of that, you COULD put your entire CraftBukkit directory into a ramdisk, but you'd want to be extra paranoid about backups. If you had a power loss, you'd lose all changes since the last backup. However, if you did put the entire CB directory into ramdisk, you'd have all plugins, their config files and any sqlite db's will be in ramdisk, so the system would have fast I/O to all those files. However, you're probably going to be fine if you put just your worlds into ramdisk. Test and see if the extra performance gain is worth the extra RAM used up by your ramdisk.

    I wouldn't bother trying to put the java application into a ramdisk - I highly doubt it will make a difference. Putting your MySQL onto an SSD, along with your OS is going to be sufficient. You could put the MySQL DB onto a ramdisk too, but that's overkill, and exposing you even further to catastrophic failure.

    Whatever you do - backup, backup, backup.
  29. Offline


    Awesome, thanks TnT for the wicked fast responce, was nice to come home from work and see :)
    Now going to set up as suggested . (with any luck )
    One more little question :p
    Do you know if there is a program / plugin for monitoring the plugins individually to see how they respond and show details of how quick they are and the resources taken by them and flag any problems?
    If any were bogging the server down or very resource hogging i could then look to finding alternatives if possible.

    This isn't a question as such but it is doing my head in as i cant understand why. When i ran 1.1R3 in testing and tried to connect with spoutcraft 1.0.1 obviously it didnt connect but it did show up in console that i had tried and displayed outdated client, my mistake as meant to connect with my minecraft which is at 1.1, after releasing this i then tried to connect with mc but it wouldnt log in to the server or show in console that an attempt for connection had been made. I tried stopping and restarting server and rebooting but still nothing showed and no connection was made when using minecraft client, i then proceeded to doing another server in a fresh folder at 1.0.1 which using spoutcraft client connected to with no trouble. Tested minecraft 1.1 and worked connecting to other 1.1 servers. like i said it's twisting my melons man ! :D
    lol just had a thought as was writing this about my ports, a quick check showed i still have that port forwarded to my current running server (from which i had ran some 1.1 tests previously) instead of being directed to the new build linux pc, maybe this was the problem? if it was then does this mean that spoutcraft will actually connect localy without having to pass out of my network where as mc needs to somehow pass some form of connection externally through the router itself?(out and in) at a guess maybe because mc authenticates clients differently with the server or needs to communicate with server to allow a connection where as spoutcraft does it a different way? If you do know the answer and reason it would be nice to know :) just for peace of mind lol
    Would have recreated the test with port corrected but i reinstalled due to not booting after trying a world ramdisk setup late last nite :/ doh! i must have done something wrong somewhere , did copy and paste (right click), maybe i missed a step, will try again in a minute and find out :p
    Thanks again for your advice :)
  30. Offline


    I had a wonderful dream that a plugin like that existed. I do not know of one that exists.
Thread Status:
Not open for further replies.

Share This Page