Small performance hiccups every 5 minutes and "cant keep up" server messages in the log
byo13 opened this issue ยท 13 comments
Modpack: Craftoria 1.20.2
Modern Industrialization v.2.3.4
It seems that whenever I deployed a few machines in my base in a chunk that is force loaded, every 5 minute neoforge saves, it leaves an additional can't keep up" message like:
[01mai.2025 18:40:01.024] [Server thread/WARN] [net.minecraft.server.MinecraftServer/]: Can't keep up! Is the server overloaded? Running 2001ms or 40 ticks behind
[01mai.2025 18:42:06.376] [Server thread/DEBUG] [net.neoforged.neoforge.common.CommonHooks/WP]: Gathered mod list to write to world save byondiworld
[01mai.2025 18:42:06.597] [Server thread/WARN] [net.minecraft.server.MinecraftServer/]: Can't keep up! Is the server overloaded? Running 3275ms or 65 ticks behind
[01mai.2025 18:47:09.043] [Server thread/DEBUG] [net.neoforged.neoforge.common.CommonHooks/WP]: Gathered mod list to write to world save byondiworld
[01mai.2025 18:47:09.309] [Server thread/WARN] [net.minecraft.server.MinecraftServer/]: Can't keep up! Is the server overloaded? Running 2737ms or 54 ticks behind
After running spark during that save window it seems that Mi was performing a "aztech.modern_industrialization.util.MISavedData.save()" even if I had a small number of machines in my base and only a few pipes connecting them (just started tutorial). Everytime a neoforge save was performed I could sense a small performance hiccup and needed to wait before doing any actions or they wouldn't work properly, like mining.
After picking up all MI machines and pipes, then restarting the server to refresh the hooks, the "can't keep up" messages are gone and only the neoforge saves are displayed:
[01mai.2025 18:56:55.511] [Server thread/INFO] [computer.heather.serverstarted.ServerStarted/]: Server Started!
[01mai.2025 19:01:53.397] [Server thread/DEBUG] [net.neoforged.neoforge.common.CommonHooks/WP]: Gathered mod list to write to world save byondiworld
[01mai.2025 19:06:53.197] [Server thread/DEBUG] [net.neoforged.neoforge.common.CommonHooks/WP]: Gathered mod list to write to world save byondiworld
[01mai.2025 19:11:53.218] [Server thread/DEBUG] [net.neoforged.neoforge.common.CommonHooks/WP]: Gathered mod list to write to world save byondiworld
[01mai.2025 19:16:53.192] [Server thread/DEBUG] [net.neoforged.neoforge.common.CommonHooks/WP]: Gathered mod list to write to world save byondiworld
[01mai.2025 19:16:53.375] [Server thread/DEBUG] [pneumaticcraft/]: 29 active Amadron offers to sync to clients
[01mai.2025 19:21:53.175] [Server thread/DEBUG] [net.neoforged.neoforge.common.CommonHooks/WP]: Gathered mod list to write to world save byondiworld
If you need any additional information, feel free to ask.
Thank you.
Just a follow up test with a different 7200 RPM disk, everytime there is a couple of MI machines and pipe system, I can see the saving process take an additional 9000 ms which freezes any actions entirely as you can see in the image:
The message is now:
[19:28:39] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 10435ms or 208 ticks behind
Taking 8000 to 9000ms longer than without any MI machines.
Thanks a lot for all your support.
Sure. Here it goes:
https://spark.lucko.me/o1yOHXiEez
Looks like just writing the file is taking a long time. Not sure there is anything I can do about this. In newer MC versions (starting from 1.21.4? maybe even a few versions earlier?), the file will be written asynchronously.
I see. :)
Is there anything I can do relieve this issue somehow in my system, I'm playing alone right now and I understand that this could be even worse when other players join and there are more loaded chunks using the MI system. This doesn't happen with other mods in the modpack right now.
Thanks a lot for your attention and reply.
Just to add some more background information, I have a base with multiple stories of mekanism, SFM and AE2 machines and complex cable systems for each and none of this is happening with them. Now if I deploy a couple of MI machines with almost no pipe system, the issue starts to happen
To give a bit more context, MI has its own implementation of saving the saveddata to make it a bit more robust: https://github.com/AztechMC/Modern-Industrialization/blob/1.21.x/src/main/java/aztech/modern_industrialization/util/MISavedData.java. This might be unnecessary now in 1.21.1 with NeoForge implementing a similar fix: neoforged/NeoForge#1001.
In any case, I suspect that your disk is very slow (or your antivirus). Could you maybe check how large the pipe data file is, so we get an idea of how much data is being written?
Hi, thank you for your support and for the amazing mod.
Actually if it was a slow disk issue wouldn't I feel this happening with other mods as well? As I mentioned I have a very complex base with rooms filled with machines (SFM + mek + ae2 + pneumaticcraft) with many automated farms and production chains, all in the same force loaded chunk. I also had another player join me last night and from time to time. When there are no deployed MI machines in a loaded chunk, there was not a single "can't keep up" message for 6 or 8 hours of the game session until I stop the server.
I took every measure to make the game run better like using recommended java params, having dedicated server in a separate disk than I'm playing, excluding the server folder from Windows search. I actively pay attention to the debug.log and the command line if I detect any sign of slowness and I find none in my current setup, except for that issue. It's just a matter of adding a few MI machines and watching it happen forever, every five minutes, until I stop the server. I will try to add the folder to Windows Defender exclusion list as well, but I'm not sure it's related.
If it helps, my disk is the following:

The MI dat files and their sizes:
modern_industrialization_pipe_networks.dat = 562 bytes
modern_industrialization_player_stats.dat = 629 bytes
(they are probably small because I was just starting the MI Guide and building the first copper machines)
I will also move my server folder to another disk (a Toshiba one) and see how it goes playing from there.
Thanks a lot.
Please let me know if you need anything else.
I did this, let's see how it goes: #1100.

