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

Over synchronization in ThreadedAnvilChunkStorage impacts performance

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Invalid
    • Minecraft 1.13, Minecraft 1.13.1
    • Minecraft 18w30b
    • None
    • Confirmed

    Description

      Developer report

      ThreadedAnvilChunkStorage overuses synchronization, resulting in massive performance drops to the server.

      Because most of the methods are synchronized, the File IO Thread writing a chunk out is done under a synchronized context, blocking the entire class.

      The main thread then will hit this class to load chunks, save chunks, check if chunks exists, etc, and will be blocked while any asynchronous chunk saving is occurring.

      This totally defeats the entire purpose of having asynchronous IO, and drastically impacts performance.

      Please see my patch (licensed MIT, or WTFPL if that makes it even easier legally) for my improvements to the Chunk Save process that has worked fine for us for years: https://github.com/PaperMC/Paper/blob/ffd9c779233fb6e5bb428d865e87c4f3d46607e0/Spigot-Server-Patches/0062-Chunk-save-queue-improvements.patch

      Attachments

        Activity

          People

            fry [Mojang] Georgii Gavrichev
            aikar Aikar
            Votes:
            9 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              CHK: