How multi-threaded is bukkit actually?

Discussion in 'Bukkit Discussion' started by OrtwinS, Aug 9, 2011.

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


    For some time I have been having strange lagspikes, and I have found out that those come from the CPU spiking to 100%.

    My server host claims that MC is single threaded

    (addtional background info)
    Show Spoiler

    Now my server host claims that MC is single threaded and that there is nothing I can do about it exept reducing plugins (even though this setup has been running fine for months, and only started lagging since CB1k )

    They claim I should pay extra to increase my RAM, but acording to the commandbook /debug info command I never actually run out of RAM, so I'm not gonna do that.

    So, I seem to remember that bukkit is multihreaded, I would like to know from people who really understand bukkit if this is true, and in what measure.
    Are worlds in seperate threads? are plugins? what more? Or is the majority of all bukkit-stuff still locked in one big thread? (I also remember that was one of the issues with hmod... so I take it the Bukkit team solved that, but I would like to know for sure).

    I would like to have some solid information on this topic to slap my host in his face because I suspect he simply only gives me 1 core out of 8 so he can host 8 servers on one machine... if that is the case I should be looking for another host, or have a serious conversation with my current one.
  2. Offline


    Not sure where you're "remembering" that from as it's pretty blatantly not multi-threaded.

    Worlds: No.
    Plugins: Only Partially and only if the programmer does so

    As of Build #1000 - the only thing that is remotely threaded about MC/Bukkit is how it handles packet/connections everything else is run from a single thread. And the majority of plugins can't circumvent this. In the dev builds (above #1000) a a bit more of the chunk compression was threaded, but there's no way to see how much it'll effect bukkit and it most likely wont all too much.

    So bottom line: yes, bukkit/MC is single threaded.

    As far as server performance - if you have more players then you'll need more CPU as it begins to load in more chunks/monsters at one time. If you've changed or added any plugins recently or if you're using any plugins that abuse onPlayerMove - they are probably the culprit. You can also lower the View distance in your to prevent the server from loading in too many chunks at once for each player
  3. Offline


    Thank you.
    Those memories probably came from discussions about more multithread support... to bad.

    I will take a carefull look at what exactly my plugins do, though I only have a few very specific ones... I am not the kind of admin that adds everything that seems funny.

    I will lower the viewdistance, the lag only occurs upon player join, so its probably the initial chunk loading.
  4. Offline


    Did lowering the view distance help any? I just read another thread where a guy said he put his to 7 and he can still see a good distance out. So i'm going to go ahead and try that out.
  5. Offline


    Yea, 7 is tolerable.

    But I think the server setting is about how much chunks are loaded on joining, not how much ppl can see maximum...
  6. Offline

    Lunar Delta

    No, it definitely lowers maximum chunk view distance.
  7. Offline


    of course they want you to buy more RAM for a CPU bottleneck. asses.
    a solution could be to lower the view distance like the others say or prevent them from teleporting so often (if they are teleporting like every 10 seconds).
    also install the lag meter plugin and see the TPS.
  8. Offline


    yea, tested that, I should have dont that before replying :p.

    As long noone is joining/leaving, I get 19.8/20 tps... tolerable for me.
  9. if bukkit is not multi threaded then how come both cores on my server are running at 80% - 90% while it is running with 5 people on it and when i stop the server they both go down to 2% - 3% at exactly the same time. have they added multi threading for chunk generation or something. also when i use a plugin to generate large portions of the world, both cores are running 100% non stop. i am confused.
  10. Offline


    I believe chunk saving and loading is now on its own thread. Also java's garbage collection is also multithreaded as well.
  11. Awesome! now i know that both cores are actually running the server.
Thread Status:
Not open for further replies.

Share This Page