[WORKAROUND] CraftBukkit #720 (and #733) Performance issue (older versions too)

Discussion in 'Bukkit Help' started by Cavalino, Apr 25, 2011.

Thread Status:
Not open for further replies.
  1. Hey everyone,

    I'm new here, so help me out if I forget stuff I should have added (in the topic title, for instance).

    I've got my little CraftBukkit server set up, currently trying the #720 build, but ever since I started running servers with CraftBukkit I've been troubled by a nasty issue.

    As soon as I start my CraftBukkit server, with nobody on it, the java.exe process running it will consume about 0,05% CPU. With just me on it, it'll go up to 5,75% (roughly). With an additional player, it shoots up to 22% and as soon as a third player joins, it's 38% and becomes unplayable due to chat lag increasing as time progresses. It's perfect with snappy responses until that 3rd player joins. All the time, lag or no lag, there isn't a single warning in the console.

    Now, some information I'm sure you'll want/need:
    CPU: Intel Core I7 860 (quadcore with hyperthreading)
    Memory: 8GB DDR3
    OS: Windows 7 Ultimate x64
    Storage: Samsung Spinpoint 7200RPM harddisk (oughta be fast enough for 3 players?)
    Java: Java(TM) 6 Update 24 (64-bit) 6.0.240 (as reported in Windows itself)
    Plugins: Only Essentials and EssentialsSpawn, nothing else. No wrappers either.

    Launch command for CraftBukkit:
    Code:
    @ECHO OFF
    SET BINDIR=%~dp0
    CD /D "%BINDIR%"
    "%JAVA%\java.exe" -server -Xms512M -Xmx2G -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=2 -XX:+AggressiveOpts -jar "C:\CraftBukkit\craftbukkit-0.0.1-SNAPSHOT.jar"
    PAUSE
    I'm wondering whether it's something I misconfigured or whether it's something else? A server running the original Minecraft server software shows considerably lower CPU usage and doesn't give any problems running with 3 or more players. I'd like to achieve that using CraftBukkit, though.

    This particular question may have already been asked many times, but I couldn't find it in my sweep of this forum just now. So if there's a solution, please point me in the right direction. Either here or towards another thread that handles the same issue already.

    Thanks,
    Cavalino
     
  2. Offline

    Plague

    I'd start with removin all those funny options except for -Xmx
     
    aidan matzko likes this.
  3. Offline

    Andre_9796

    yeah, just use the simple, recommended launcher:
    Code:
    @ECHO OFF
    SET BINDIR=%~dp0
    CD /D "%BINDIR%"
    "%ProgramFiles%\Java\jre6\bin\java.exe" -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar
    PAUSE
     
  4. I'll give the original launch command a try, but my feeling tells me that's not going to change the issue. I'll update in a moment.

    Update: Tried that. I get the exact same results. So that's not it.
     
  5. Offline

    xupwup

    Disable hyperthreading, because it only helps your performance if you run a lot of threads, and minecraft server has only 1 (active) thread.
     
  6. Xupwup: How does that explain Vanilla running smooth? I don't get that difference.
     
  7. Offline

    Nathan C

    I had 710 running and it is the best performance I have ever had with my server.

    The new update is running better than 1.4 ever did for me.
     
  8. Offline

    xupwup

    Craftbukkit probably requires more cpu power.

    Anyway, hyperthreading is very good for some workloads, and sucks for others. Minecraft server is one of those workloads that it does not work for.

    Also, you might want to take a look at your disk activity. If that is extremely high, you might want to take a look at a ramdisk.
     
  9. I have a RAMdisk standing by, but 3 players...I refuse to believe my normal 7200RPM disk can't handle 3 players! If I had like 15 or more, sure..but 3?

    Also: Maybe worth mentioning I have passive mobs and monsters enabled. The latter category seems to have a MAJOR influence in performance and lag. But hey, It's survival right? So there should be a way around that.
     
  10. Offline

    xupwup

    I don't know, but if your disk IS your bottleneck, why not use a ramdisk? You are right that this should not be the problem, but if it is, why not work around it?
     
  11. Every little bit helps, of course, but it's not the issue I'm trying to resolve. It's not like I want 10+ people on it, but around 4 ~ 5 should be a normal load for my circumstances. Can't do it though.

    Running a perfmon on I/O at the moment, and there's nothing serious going on. It's not the disk.

    Update: PerfMon reports Disk Writes Bytes/sec averaging out at 47.000 bytes/sec and peaking around 450.000 bytes/sec. With a disk capable of sustained writes around 70MB/s I guess it rules out the disk as being the bottleneck. Besides: if the disk were a bottleneck, the CPU should have to wait more than being able to do stuff..and I'd get the 'Can't keep up!' messages. Nothing of the sort.
     
  12. Offline

    Plague

    omg another one of those disable swap disable HT gyus...
    This does not help, read something about what HT is and how context switching works.
     
    Mitsugaru likes this.
  13. Erm..is that aimed at me? If so, could you please explain what I'm doing wrong?

    I just tried with monsters turned off: no problem. But as soon as I turn those on, the whole thing starts lagging like mad.

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

    blutherz

    If you don't want to use a ramdisk, then use 4 harddisk in a raid 1+0 config.
     
  15. I don't mind using a ramdisk, but there's no need for that with only up to 5 players. Disk is more than fast enough and I'm not getting any warnings it can't keep up.
     
  16. Offline

    TnT

    Try it, see if it helps.
     
  17. Offline

    Nathan C

    I doubt it is disk I/O too.

    I have a dedicated server that runs BigBrother MySQL database with over 715,000 entries,a plugin that logs everyones block placement, so it can auto protect it and a website all on a 7,200 RPM hard drive. I had 42 players on and it kept up just fine.

    Oh also, it was running 3 minute rsyncs from the RAMdisk on the other server to the hdd and 4 hour full world backups for 3 different worlds.

    So I doubt it is a disk problem, unless you have a lot of crap running in the background.
     
  18. Just tried it.

    No noticeable difference with HDD whatsoever. I.e. as soon as player 3 joins..chat lag is there and keeps getting worse over time. Build/destroy response is still fine.

    Re-iterating that 3 players without monsters is still perfect. Don't have more to try a bigger load, but the problems occur when monsters are turned on (for now it seems that way at least).
     
  19. Offline

    Nathan C

    Maybe list the plugins you are using?

    EDIT: And your speedtest.
     
  20. I'm running just Essentials and EssentialsSpawn, nothing else. No wrappers, either.

    Internet connection: 60mbit down, 6 up.
     
  21. Partly bumping, partly reiterating what has been tried so far:

    1. Tried build #720 and just now #733 - No difference.
    2. Tried both my launch command (the complicated one in the original post) and the recommended one - No difference.
    3. I ran the server/world from a RAMdisk to exclude I/O as a bottleneck - No difference.
    4. I removed all plugins (Essentials/EssentialsSpawn) - No difference.
    5. I turned off monsters - Big difference, although cpu usage remains abnormally high for the (absence?) of load.

    Update 8:28 p.m. : I just tried running CraftBukkit on an IKVM .NET Java basis (read it in a post up here).I get the same results (yet again). Very high CPU usage (~40%) and a couple of seconds of (chat)lag as soon as the third player joins the game. As soon as player 3 leaves everything is peachy again, though CPU usage remains abnormally high with CraftBukkit (drops from 38 ~ 40% down to 20 ~ 22% when player 3 leaves). Mind you, we're all in the same area doing..nothing but standing there seeing if there's lag or not.

    Anyone have any ideas? Things I can try? Please refer to my original post for specifications. Slowly losing hope. :(
     
  22. Offline

    kildyu

    I get the same issue as Cavalino, same specs except, i7 920 and a WesternDigital 7200 RPM disk. I can support at least 6 players with monsters on a regular MC server, but with Craftbukkit it is just unplayable. Have tried starting the server with 32 bit and 64 bit java, didn't seem to help at all.

    I also run NetWorx to monitor network usage, a regular minecraft server easily uploads over 200kb/s when people join, however I noticed that craftbukkit rarely breaks 20 kb/s. Not sure what that means, but I hope it helps.
     
  23. Update:

    I decided to try something completely different, but boy did it pay off. Here's what I did:

    1. Installed VMware Player (free software)
    2. Got me one of the pre-configured Ubuntu 10.10 packages (also completely free)
    3. Fired it up giving it 4 (out of 8) cores and 3GB (out of 8GB) RAM. Didn't know what I needed, so I just went with something, really.
    4. Installed Java
    5. Installed CraftBukkit #733 with Essentials and EssentialsSpawn
    6. Made the little .sh file to launch it, and launched it using default flags
    7. Brought in 5 people who went absolutely nuts with spawning creepers, stacking hundreds of TNT...and all that accomplished after a while of testing was a CPU peak of about 12% (yes...only 12%), a lot of crashing Minecraft clients and zero (!) lag.

    So, between all I have tried under Windows...and a virtual Linux installation running under Windows...is a world of difference and all my troubles are gone. I haven't even begun optimizing the Linux set-up yet and it's already running smoother than a baby's bottom.

    Thanks for the tips.

    I still don't know what to do to make it run on Windows, but for now this Ubuntu set-up is a solid (easy and free) solution. :)

    Cavalino
     
  24. Offline

    Moetrix

    For me it sounds like theres something wrong with your Java installation on your windows OS.
    Im having 8 players play on a 3ghz pentium Windows Server 2008 with 2gb ram. CPU at about 20% :)
     
  25. Offline

    Xphome

Thread Status:
Not open for further replies.

Share This Page