mojira.dev
MC-279194

Sever tick lag spike while data files are saving

I am running a dedicated Minecraft server that performs normal gameplay just fine but gets a massive (~3s) lag spike every 5 minutes, for only one tick. Using a performance profiler, the lag spikes come down to these methods:

net.minecraft.world.level.storage.LevelStorage$Session.backupLevelDataFile()

net.minecraft.server.PlayerManager.saveAllPlayerData()

In my particular case, the level data file is taking the most time, but the player data seems to be significant as well. To confirm, when the lag spikes occur, I can plainly see the temp files being created for them in file explorer. Could these tasks be ran asynchronously on a separate thread as to not halt the server tick loop?

[media]

Attachments

Comments 6

We do not have enough information to find the cause of this issue.

While the lag occurs, please press F3 + L once, then wait a short moment until profiling has finished.
Afterwards, please attach the generated .zip file containing the profiling results here. The file path is shown in chat; the file can be found in [minecraft/debug/profiling/<DATE>.zip|https://minecrafthopper.net/help/finding-minecraft-data-folder/].

If you are playing on a server please additionally run the command /perf start to create a profiling report for the server. In case you do not have the permission to run this command, make sure that you're a server operator.
Once profiling has finished, please attach the generated .zip file from debug/profiling/<DATE>.zip of the server folder.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
πŸ““ Bug Tracker Guidelines – πŸ’¬ Community Support – πŸ“§ Mojang Support (Technical Issues) – πŸ“§ Microsoft Support (Account Issues)
πŸ““ Project Summary – ✍️ Feedback and Suggestions – πŸ“– Game Wiki

I have now attached the client and server profiles to the issue. I wasn't getting the lag spike quite as big as before but it was still noticeable while it occurred (~500ms).

Have you tried disabling sync-chunk-writes in the server.properties file? The option was introduced a few versions ago and I believe this defaults to true on Windows to fix some other issues

The server is still getting tick spikes with sync-chunk-writes=false.

Im getting this same β€˜error’ on a 1.21.1 Fabric (would like to test it on vanilla java but the world is heavily modded…) server. Weird thing it is only happening with one of our machines .

Is there any easy way this can be reproduced?

TCAtrevor

(Unassigned)

Unconfirmed

Performance

1.21.4

Retrieved