LunaPixelStudios / SteamPunk

8 stars 3 forks source link

Chunk generation lag #292

Closed Noodle565 closed 1 week ago

Noodle565 commented 3 weeks ago

Describe the Bug

My friends and I have been playing on a Steampunk server for the past month or so. Chunk generation was always an issue, but recently it has gotten to the point where chunks are taking minutes at a time to load.

Our server is hosted on a Linux distribution using default oracle JVM. We allocated 10gb to the server. The weird thing is, the server runs very well when it is not generating chunks. As soon as it requests new ones, the performance immediately tanks. We profiled performance with and without chunk optimization mods, and they made zero impact. The server utilities as much CPU as possible when loading, but then only gets up to 50% when loading chunks (which makes us think it might be Minecraft's chunk-loading algorithm combined with something else from this modpack).

We even did a bit of testing ourselves. The forge tick profiler is saying the tps is fine, but the vanilla one is saying it goes down to like 2.3 tps while the chunks are slowly generating. We have a massive buffer on actual tick duration, but even with all this headroom chunks still generate slowly. -Also found a mod called "ModernFix" that is apparently using outdated structure files, which can cause delays to chunk loading? Doesn't explain the slow chunk loading all the time though...

Pls help, i dont want the server to die :(

Reproduction Steps

  1. Play steampunk
  2. Explore out side pre-loaded chunk area
  3. Horrible chunk-generation delays ...

Screenshots and Videos

2024-07-10_18 22 27 image image2

Crash Report or Log

No response

Operating System

Windows(Client), Linux(Server)

Minecraft Version

1.19.2

Modloader

Forge

Modpack Version

v24

Other Mods

No response

SHXRKIEgg commented 3 weeks ago

Could you do a spark profiler, type /spark profiler --timeout 60 in game and let it run while trying to load those chunks then send the link here. The ModernFix thing you can ignore, also are these new chunks or old ones?

chorbintime commented 3 weeks ago

The ModernFix mod is not using outdated structure files. The log prints are simply ModernFix upgrading old structures from other mods to a newer format, which improves performance.

I also highly recommend changing your server's Java to GraalVM 21 instead of the default Oracle one.

chorbintime commented 3 weeks ago

didnt mean to close oops :p

Noodle565 commented 3 weeks ago

Hello,

Thank you for the prompt responses! Attached is the spark profile I ran just now, flying over a section of the world that had never been explored before. https://spark.lucko.me/1Oq9GySqxY

The chunk bug can happen anywhere as it seems, which is really really weird because our base is force-loaded and preloaded... It seems to happen the most when multiple people are generating new chunks at the same time. The 1st and 2nd screenshots I initially posted happened at the same time, where my friend was back at our base, and I was generating new chunks.

I will also look into GraalVM. Thanks for the suggestion 👍

SHXRKIEgg commented 3 weeks ago

The link you send doesnt show any issues with TPS, could you run it while people are loading chunks?

Noodle565 commented 3 weeks ago

I took the profile while actively loading chunks. Spark (and seemingly forge) don't seem to accurately reflect the TPS on the server. Only the vanilla debug profiler shows us a decrease in TPS.

EDIT: We copied all of our persistent data over to a new world with the same seed. The chunk performance is now back to what it was originally (we can use elytra again), but it still isnt great.

SHXRKIEgg commented 3 weeks ago

Try to have less loaded chunks cause imagine all those machines running will cause a lot of performance. Could you send a longer profiler then?