DHS causes huge lags and eventually stops my server

When my friend (who also uses DH installed on their client) joins my server it keeps generating LODs and server lags a lot. If I try manually running dhs pregen start world 0 0 110 it lags a lot, in the console I can see shortly before it stops:
[03:16:37] [Spigot Watchdog Thread/ERROR]: The server has stopped responding! This is (probably) not a Spigot bug.
[03:16:37] [Spigot Watchdog Thread/ERROR]: If you see a plugin in the Server thread dump below, then please report it to that author
[03:16:37] [Spigot Watchdog Thread/ERROR]: *Especially* if it looks like HTTP or MySQL operations are occurring
[03:16:37] [Spigot Watchdog Thread/ERROR]: If you see a world save or edit, then it means you did far more than your server can handle at once
[03:16:37] [Spigot Watchdog Thread/ERROR]: If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes
[03:16:37] [Spigot Watchdog Thread/ERROR]: If you are unsure or still think this is a Spigot bug, please report to https://www.spigotmc.org/
[03:16:37] [Spigot Watchdog Thread/ERROR]: Be sure to include ALL relevant console errors and Minecraft crash reports
[03:16:37] [Spigot Watchdog Thread/ERROR]: Spigot version: 4533-Spigot-7c52c66-e703c03 (MC: 1.21.8)
[03:16:37] [Spigot Watchdog Thread/ERROR]: The server has stopped responding! This is (probably) not a Spigot bug.
[03:16:37] [Spigot Watchdog Thread/ERROR]: If you see a plugin in the Server thread dump below, then please report it to that author
[03:16:37] [Spigot Watchdog Thread/ERROR]: *Especially* if it looks like HTTP or MySQL operations are occurring
[03:16:37] [Spigot Watchdog Thread/ERROR]: If you see a world save or edit, then it means you did far more than your server can handle at once
[03:16:37] [Spigot Watchdog Thread/ERROR]: If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes
[03:16:37] [Spigot Watchdog Thread/ERROR]: If you are unsure or still think this is a Spigot bug, please report to https://www.spigotmc.org/
[03:16:37] [Spigot Watchdog Thread/ERROR]: Be sure to include ALL relevant console errors and Minecraft crash reports
[03:16:37] [Spigot Watchdog Thread/ERROR]: Spigot version: 4533-Spigot-7c52c66-e703c03 (MC: 1.21.8)
and then additionally:
[03:16:41] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 71429ms or 1428 ticks behind
[03:16:41] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 71429ms or 1428 ticks behind
I've already tried changing settings in the config file:
render_distance: 128
scheduler_threads: 8
generate_new_chunks: true
render_distance: 128
scheduler_threads: 8
generate_new_chunks: true
I've already tried following https://discord.com/channels/881614130614767666/1035937626944962641/1350101909683572736 and https://gitlab.com/distant-horizons-team/distant-horizons-server-plugin/-/wikis/home and currently all I can do to play with friends is /dhs pause as lags are unbearable
Solution:
Use a server software that has asynchronous world generation, like Paper
Jump to solution
14 Replies
Puhpine
Puhpineโ€ข4d ago
how much ram does the server have allocated? what hardware is running your server?
Miki_P98
Miki_P98โ€ข4d ago
Try reducing the thread count
โ“๐™Œ๐™ช๐™š๐™จ๐™ฉ๐™ž๐™ค๐™ฃ ๐™ˆ๐™–๐™ง๐™ โŽโงน\
Do you mean scheduler_threads: 8 to like 1 or 2 ? I tried that, it was 4 by default, now set to 8 and no difference
java -Xms16G -Xmx16G -XX:+UseZGC -XX:+UseCompactObjectHeaders -jar spigot-1.21.8.jar nogui
java -Xms16G -Xmx16G -XX:+UseZGC -XX:+UseCompactObjectHeaders -jar spigot-1.21.8.jar nogui
Command that I use to start, I have AMD 7800X3D and memory 64 GB 6000 MHz
Miki_P98
Miki_P98โ€ข4d ago
8 should use twice the memory and CPU resources of 4 2 will use half Decreasing the lag Try setting it to 1
Jckf
Jckfโ€ข4d ago
You have not followed the recommendations of the wiki, which I directly advised in your previous post. Your server undoubtedly prints a warning stating that "performance will suffer" ever time you start it The reason you get lag is worldgen. It is triggered by DHS, but not directly caused by it
Solution
Jckf
Jckfโ€ข4d ago
Use a server software that has asynchronous world generation, like Paper
Jckf
Jckfโ€ข4d ago
And/or pregen your world Both of these recommendations are on the wiki
โ“๐™Œ๐™ช๐™š๐™จ๐™ฉ๐™ž๐™ค๐™ฃ ๐™ˆ๐™–๐™ง๐™ โŽโงน\
Okay, I'm looking at https://gitlab.com/distant-horizons-team/distant-horizons-server-plugin/-/wikis/Recommended-setup again and it says This pretty much rules out Spigot or any direct fork of Spigot, except Paper So you're telling the solution is to remove Spigot and make the server again using Paper?
Jckf
Jckfโ€ข4d ago
You don't need to recreate anything. Just replace your server.jar with one from Paper It's a drop-in replacement
โ“๐™Œ๐™ช๐™š๐™จ๐™ฉ๐™ž๐™ค๐™ฃ ๐™ˆ๐™–๐™ง๐™ โŽโงน\
# Should new chunks be generated to build LODs?
# If you disable this, the plugin will not be able to create LODs in areas where chunks don't already exist.
# Optional.
# Default: true
generate_new_chunks: true
# Should new chunks be generated to build LODs?
# If you disable this, the plugin will not be able to create LODs in areas where chunks don't already exist.
# Optional.
# Default: true
generate_new_chunks: true
Doesn't DHS do that? I thought if I set this option it'll generate world chunks as well as LODs Okay, I'll try that, thanks!
Jckf
Jckfโ€ข4d ago
It does, but areas that are pre-generated will be much faster to generate LODs for afterwards If you tune DHS for your hardware, it is possible to get essentially the same performance as Chunky. But it is easier to just recommend Chunky
โ“๐™Œ๐™ช๐™š๐™จ๐™ฉ๐™ž๐™ค๐™ฃ ๐™ˆ๐™–๐™ง๐™ โŽโงน\
After replacing Spigot with Paper it seems to work better, there are colors in the console now LOL I'm still testing... And it doesn't lag the server when I run DHS pregen!
Jckf
Jckfโ€ข4d ago
Haha, yes there is a reason the wiki says to avoid Spigot And that the plugin prints "performance will suffer" when it doesn't detect a server capable of async worldgen But I guess it was difficult to see that warning if you didn't have colors in the console before
โ“๐™Œ๐™ช๐™š๐™จ๐™ฉ๐™ž๐™ค๐™ฃ ๐™ˆ๐™–๐™ง๐™ โŽโงน\
Yes, you're right. I didn't notice it at all, when I start the server the console is bloated with a wall of text, now you told me and I check and indeed it was warning me. I also didn't notice the notice we recommend that you go with one that has asynchronous chunk loading. This pretty much rules out Spigot or any direct fork of Spigot, except Paper I was going straight below to copy these Java flags. Thanks a lot for helping me, it seems this issue is resolved :distanthorizons:
No description

Did you find this page helpful?