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

Horrible server performance since changes to auto-saving in 1.18-pre6

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 22w05a
    • 1.18.1, 22w03a
    • None
    • Plausible
    • Networking, Performance
    • Important

      Placing/breaking blocks or running redstone in a chunk with block entities containing items (such chests containing items/shulkers) can cause significant server performance issues.

       

      Steps to reproduce:

      1. Download & load up the "Performance Test World" attached to this bug report.

      2. Press Alt+F3 to bring up the debug screen with performance graphs.

      3. Turn on the redstone clock that's inside the same chunk as the chests containing shulkers full of items.

      4. Observe the poor performance in the TPS graph.

       

      Upon running the built-in debug performance profiler, the majority of the server tick time is seen being consumed by "chunk_unload". It appears that whenever a chunk experiences a change, the game will attempt to save that chunk regardless if the chunk had already been saved recently or not. Disabling auto-save in a multiplayer server with the /save-off command will see performance return to normal, confirming the cause of this issue is the current implementation of auto-save.

       

      When testing previous versions of the game I've found 1.18-pre6 to be the first version to exhibit this issue. Versions 1.18-pre5 and earlier are unaffected by this specific scenario.

       

      In 1.18-pre6 a technical change to auto-saving was made:

      This technical change may have been made in an attempt to address another issue: MC-239474

      MC-243760 may also be related.

       

      Additionally I’ve also observed increased memory usage during testing. I speculate that a lot of short lived objects may be getting created every time chunk data is saved, causing higher memory usage and more frequent GC’s. However I’m not able to do code analysis so I cannot confirm if the increased memory usage I’ve seen is related to this issue.

       

      I first discovered this issue when I updated a singleplayer creative world that had a small storage system in it to 1.18.1. I noticed that when I ran that storage system performance was significantly worse then it was 1.17.1. Instead of only consuming 3-5 MSPT like it did in 1.17.1, it was now running at almost 50 MSPT.

        1. 2022-01-16_14.20.55-Test-Storage-Hall-Running.png
          3.56 MB
          ExperimentalIdea
        2. 2022-01-16_14.29.13-Performance Test.png
          925 kB
          ExperimentalIdea

            Unassigned Unassigned
            Dukecool15 ExperimentalIdea
            Votes:
            12 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: