Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-118106

High CPU usage, lag and poor performance on dedicated / integrated servers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • None
    • Minecraft 1.12 Pre-Release 7, Minecraft 1.12, Minecraft 1.12.2, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 17w48a, Minecraft 17w49a, Minecraft 17w49b, Minecraft 18w01a, Minecraft 18w02a, Minecraft 18w06a, Minecraft 18w07a, Minecraft 18w07b, Minecraft 18w07c, Minecraft 18w08a, Minecraft 18w11a, Minecraft 18w14a, Minecraft 18w14b, Minecraft 18w15a, Minecraft 18w16a, Minecraft 18w19a, Minecraft 18w19b, Minecraft 18w20a, Minecraft 18w20c, Minecraft 18w21a, Minecraft 18w21b, Minecraft 18w22a, Minecraft 18w22b, Minecraft 18w22c, Minecraft 1.13-pre1, Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre4, Minecraft 1.13-pre5, Minecraft 1.13-pre6, Minecraft 1.13-pre7, Minecraft 1.13-pre8, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w30a, Minecraft 18w30b, Minecraft 18w31a, Minecraft 18w32a, Minecraft 1.13.1-pre1, Minecraft 1.13.1-pre2, Minecraft 1.13.1, Minecraft 1.13.2-pre1, Minecraft 1.13.2-pre2, Minecraft 1.13.2, Minecraft 18w43a, Minecraft 18w43b, Minecraft 18w43c, Minecraft 18w44a, Minecraft 18w45a, Minecraft 18w46a, Minecraft 18w47a, Minecraft 18w47b, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03a, Minecraft 19w03b, Minecraft 19w03c, Minecraft 19w04a, Minecraft 19w04b, Minecraft 19w05a, Minecraft 19w06a, Minecraft 19w07a, Minecraft 19w08a, Minecraft 19w08b, Minecraft 19w09a, Minecraft 19w11a, Minecraft 19w11b, Minecraft 19w12a, Minecraft 19w12b, Minecraft 19w13a, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b, Minecraft 1.14 Pre-Release 1, Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 3, Minecraft 1.14 Pre-Release 4, Minecraft 1.14 Pre-Release 5, Minecraft 1.14, Minecraft 1.14.1 Pre-Release 1, Minecraft 1.14.1 Pre-Release 2, Minecraft 1.14.1, Minecraft 1.14.2 Pre-Release 1, Minecraft 1.14.2 Pre-Release 2, Minecraft 1.14.2 Pre-Release 3, Minecraft 1.14.2 Pre-Release 4, Minecraft 1.14.2, Minecraft 1.14.3 Pre-Release 2, Minecraft 1.14.3 Pre-Release 3, Minecraft 1.14.3 Pre-Release 4, Minecraft 1.14.3, Minecraft 1.14.4 Pre-Release 1, Minecraft 1.14.4 Pre-Release 2, Minecraft 1.14.4 Pre-Release 3, Minecraft 1.14.4 Pre-Release 4, Minecraft 1.14.4 Pre-Release 5, Minecraft 1.14.4 Pre-Release 6, 1.14.4, 19w34a, 19w35a, 19w36a, 19w37a, 19w38b, 19w39a, 19w40a, 19w41a, 19w42a, 19w45b
    • Confirmed
    • Performance

      Multiplayer / Integrated servers have very poor performace and cannot keep up even with one player on a high-end PCs / Servers / Machines

      Description

      Vanilla server platforms (integrated and external) are very poorly optimized and can barely run smoothly, even on a high-end hardware with higher amounts of memory allocated.

      Typical, small multiplayer server drops to critically low TPS and can crash / be forcibly shut down by the watchdog (if enabled) with just a few players normally generating new chunks (in survival gamemode).

      A server, using the "Default GUI" is almost impossible to run stable. When launching it via command line and allocating sufficient amount of RAM, the performance is a little bit better (and the server is not running out of memory), but the playing experience is still very rough and there is quite a lot of rubber-banding, freezes, lag spikes, etc.

      How to reproduce the issues & Testing methods
      Singleplayer (Integrated Server)
      • Launch the game with plenty of memory allocated (4GB is usually more than enough)
      • Enter into a world or create a new one
      • If creating a new world, initially there are extreme framerate drops (probably client-side issue), the integrated server is rubber-banding and skipping ticks
      • Start exploring the terrain around and perform the usual things (generating / loading new chunks, dropping item entities, etc.) - There will be noticable stuttering, lag and rubber-banding when punching mobs or making redstone circuits, for example
      • If the player is in creative mode (or spectator mode) then everything becomes much worse

      If you are playing in a survival world for long enough (assuming there are animal pens / farms, some mob grinders, chest rooms with item frames and similar) the world will run much slower and this can cause issues with redstone circuits, influence on the gameplay and so on.

      Multiplayer (Vanilla platform, without any mods / tweaks / changes)
      • Start a server on a relatively powerful hardware with sufficient amount of memory allocated (4GB again, would be probably more than enough)
      • Join the server, along with a few other players (2-4 players at the same time is normal, 5+ will be a bit heavier)
      • Start playing as usual (exploring around, interacting with entities, mobs, items) - There will be clearly noticable rubber-banding and lag spikes, which usually result in stuttering entities, desyncing issues between the clients and the server and other

      If some of the players start to generate new chunks on creative mode, the server will most likely crash.

      Testing methods & RAM allocation

      Tested and experimented with many combinations of JVM heap sizes (amount of memory allocated), using the default, "recommended" start-up command line:

      java -Xms<Initial Memory>M -Xmx<Max Memory>M -jar <Server Jar>.jar nogui

      (Xms = Starting Memory / Xmx = Maximum Memory)

      • Xms1024M / Xmx1024M
      • Xms2048M / Xmx2048M
      • Xms3072M / Xmx3072M
      • Xms4096M / Xms4096M
      • Xms6144M / Xmx6144M
      • Xms8192M / Xmx8192M
      • Xms1024M / Xmx2048M
      • Xms1024M / Xmx3072M
      • Xms1024M / Xmx4096M
      • Xms1024M / Xmx6144M
      • Xms1024M / Xmx8192M
      • Players at the same time: 1-3, 3-5, 5-10
      Usual activities during the tests:
      • Exploring the terrain around in survival mode, creative mode (for a while), spectator mode (just for the experiments, not expecting actual results)
      • Interacting with mobs, entities, armor stands, droppping and picking up item entities
      • Placing water and lava (creates many block updates)
      • Small, medium and advanced redstone circuits (light, piston, hopper updates)
      • Small, medium and large mob farms / grinders
      • Updating gravity-affected blocks (sand, gravel, concrete powder)
      • Entering different dimensions and teleporting items, mobs, entities through portals
      • Transfering small and large amounts of items through hoppers
      • Loading previously generated and alredy saved chunks

      The RAM & CPU usage (especially) was abnormally high for very small and short activities or sometimes none at all. Not only chunk generation is causing the more serious issues (but mainly it is).

      Conclusion

      The main reason for most of the issues is not exactly the TPS drop / loss / poor server performance, but client-side ticking, updates and synchronization.
      Other games (clients) handle the updates, coming from the server in different way.
      If the server can't keep up with the consistend update rate / tick rate, then the client should enable some sort of "interpolation" and increase slightly the delay between the changes (updates).

      The Minecraft client runs at hardcoded 20 TPS and waits for the next tick from the server. If it is synchronized (matches with the incoming client update / tick) then it runs normally.
      But even if the server drops to 19.99 TPS - There is desynchronization once in a while and this can create issues (mainly client-side).

      Overall, the server performance should be definetly optimized more and some things can be tweaked.

      Related issues: MC-117611, MC-44385MC-4890MC-342MC-54026

        1. CPU.png
          22 kB
          Jack Rambusch

            Unassigned Unassigned
            VideoklipBG VideoklipBG
            Votes:
            155 Vote for this issue
            Watchers:
            71 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: