High CPU usage when terrain generation shouldn't be running

I have 100% CPU usage despite no one being on the server, terrain generation being set to disabled and no pregen running. The CPU usage also never drops off. I have already generated a huge amount of terrain using both a high range around the player and pregen. (3.86gb with LZMA2) Since then I have set the player generation range pretty low, since all relevant terrain should already be generated. Since that didn't fix it, I've also turned off distant terrain generation. However CPU usage continues to be at 100%, regardless of whether there is even any players on the server. Obviously I can reduce the CPU usage by not setting it to "I paid for the whole CPU", but I would expect DH to also idle when there isn't anything new to generate. But for some reason it is not :( My best guess for what is happening is that DH is continuously updating random chunks, as the sqlite file doesn't seem to grow in size despite all the CPU usage. Is this intended behaviour and if so can I somehow reduce that? I am running a localhost 1.21.4 fabric server with the following mods: architectury 15.0.3 BeamBeGone 0.0.2 carpet-extra 1.4.161 cloth-config 17.0.144 DistantHorizons 2.3.0-b fabric-api 0.118.0 fabric-carpet 1.4.161 ferritecore 7.1.1 jamlib 1.3.2 lithium 0.14.8 NoChatReports 2.11.0 rightclickharvest 4.5.1 servux 0.5.2 textile-backup 3.1.3
17 Replies
Puhpine
Puhpine2mo ago
how much ram did you allocate to the server?
MordorsElite
MordorsEliteOP2mo ago
My default config uses 8GB, but right now I am running the server with 24GB and both have 100% CPU usage. To be clear, I don't have the most powerful CPU (i5-8600k), so only 6 cores, 6 threads, but I would have expected that when there isn't anything to generate, CPU usage would go back to essentially zero like would be the case for the same server without DH installed.
Puhpine
Puhpine2mo ago
yea thats how it should work does the same happen with just DH installed? can you test that?
MordorsElite
MordorsEliteOP2mo ago
without the other mods you mean?
Puhpine
Puhpine2mo ago
yea
MordorsElite
MordorsEliteOP2mo ago
I'll set up a new server and check
Puhpine
Puhpine2mo ago
might need to make a backup, not sure what some of those mods do alright
MordorsElite
MordorsEliteOP2mo ago
Ok. This does seem to be either some other mod influencing it or a configuration issue. Using DH on a completely fresh Fabric server shows the intended usage. Pretty much zero usage when starting up the server, 100% usage when pregenning some terrain, then pretty much 0% usage once pregen is complete. I'm gonna try adding back some of the mods to see if I can figure out if one of them is causing the issue. Well, I have now added all the mods back to the new server and its still working as intended. No usage when the server is empty, full usage when I as the player join (cause not all 256 chunks of terrain are generated yet around the player), but it also drops off to 0% usage as soon as the player leaves. The two servers should now be equal in config and mods, but unfortunately I cannot recreate the behaviour of my main server :( The test server works exactly as one would expect
Puhpine
Puhpine2mo ago
Very odd
MordorsElite
MordorsEliteOP2mo ago
I've now made a backup and completely removed all previous DH data as well as copied over the fresh config from the test server (just to be sure). However running that on my main server, I am still seeing the same issues :( Does the /dh debug thingy maybe have some info?
dh debug
[17:14:23] [Server thread/INFO]:
Distant Horizons: 2.3.0-b

World Gen/Import, Tasks: 0, Done: 0, Active: 0/6, Avg: <0ms
File Handler, Tasks: 0, Done: 16, Active: 0/6, Avg: 5ms
Update Propagator, Tasks: 1, Done: 443, Active: 0/6, Avg: 30ms
LOD Builder, Tasks: 7, Done: 721, Active: 6/6, Avg: 6.071ms
Networking, Tasks: 0, Done: 16, Active: 0/6, Avg: 2ms

Queued chunk updates: 854 / 6.000

SERVER_ONLY World with 3 levels

[minecraft:the_nether]
World Gen/Import Tasks: 0/0 (in progress 0)

[minecraft:the_end]
World Gen/Import Tasks: 0/0 (in progress 0)

[minecraft:overworld]
World Gen/Import Tasks: 0/0 (in progress 0)

dh debug
[17:15:01] [Server thread/INFO]:
Distant Horizons: 2.3.0-b

World Gen/Import, Tasks: 0, Done: 0, Active: 0/6, Avg: <0ms
File Handler, Tasks: 0, Done: 16, Active: 0/6, Avg: 5ms
Update Propagator, Tasks: 3, Done: 474, Active: 0/6, Avg: 25ms
LOD Builder, Tasks: 9, Done: 758, Active: 6/6, Avg: 5.854ms
Networking, Tasks: 0, Done: 16, Active: 0/6, Avg: 2ms

Queued chunk updates: 850 / 6.000

SERVER_ONLY World with 3 levels

[minecraft:the_nether]
World Gen/Import Tasks: 0/0 (in progress 0)

[minecraft:the_end]
World Gen/Import Tasks: 0/0 (in progress 0)

[minecraft:overworld]
World Gen/Import Tasks: 0/0 (in progress 0)
dh debug
[17:14:23] [Server thread/INFO]:
Distant Horizons: 2.3.0-b

World Gen/Import, Tasks: 0, Done: 0, Active: 0/6, Avg: <0ms
File Handler, Tasks: 0, Done: 16, Active: 0/6, Avg: 5ms
Update Propagator, Tasks: 1, Done: 443, Active: 0/6, Avg: 30ms
LOD Builder, Tasks: 7, Done: 721, Active: 6/6, Avg: 6.071ms
Networking, Tasks: 0, Done: 16, Active: 0/6, Avg: 2ms

Queued chunk updates: 854 / 6.000

SERVER_ONLY World with 3 levels

[minecraft:the_nether]
World Gen/Import Tasks: 0/0 (in progress 0)

[minecraft:the_end]
World Gen/Import Tasks: 0/0 (in progress 0)

[minecraft:overworld]
World Gen/Import Tasks: 0/0 (in progress 0)

dh debug
[17:15:01] [Server thread/INFO]:
Distant Horizons: 2.3.0-b

World Gen/Import, Tasks: 0, Done: 0, Active: 0/6, Avg: <0ms
File Handler, Tasks: 0, Done: 16, Active: 0/6, Avg: 5ms
Update Propagator, Tasks: 3, Done: 474, Active: 0/6, Avg: 25ms
LOD Builder, Tasks: 9, Done: 758, Active: 6/6, Avg: 5.854ms
Networking, Tasks: 0, Done: 16, Active: 0/6, Avg: 2ms

Queued chunk updates: 850 / 6.000

SERVER_ONLY World with 3 levels

[minecraft:the_nether]
World Gen/Import Tasks: 0/0 (in progress 0)

[minecraft:the_end]
World Gen/Import Tasks: 0/0 (in progress 0)

[minecraft:overworld]
World Gen/Import Tasks: 0/0 (in progress 0)
The LOD builder still seems to be using all 6 threads, despite no one being on the server. Not sure why it still continues to do stuff.
Nightly
Nightly2mo ago
I’m having the same issue
MordorsElite
MordorsEliteOP2mo ago
An additional observation: I occasionally get a couple of these warnings, even when no one is on the server (after setting thread count to 1):
Max queue count [1000] ([1000] per thread+players).
[18:15:02] [DH-PriorityTaskPicker Thread[4]/WARN]: §6Distant Horizons overloaded, too many chunks queued for LOD processing. §r
This may result in holes in your LODs.
Fix: move through the world slower, decrease your vanilla render distance, slow down your world pre-generator (IE Chunky), or increase the Distant Horizons' CPU thread counts.
Max queue count [1000] ([1000] per thread+players).
list
Max queue count [1000] ([1000] per thread+players).
[18:15:02] [DH-PriorityTaskPicker Thread[4]/WARN]: §6Distant Horizons overloaded, too many chunks queued for LOD processing. §r
This may result in holes in your LODs.
Fix: move through the world slower, decrease your vanilla render distance, slow down your world pre-generator (IE Chunky), or increase the Distant Horizons' CPU thread counts.
Max queue count [1000] ([1000] per thread+players).
list
The plot thickens! The issue seems to be specific to the spawn chunks (or their surroundings). I have now made a 1:1 copy of my server files, and changed nothing but removing the 4 region files surrounding the 3x3 spawn chunk area. This has seemingly fixed the issue completely. So my guess is that running a chunkloader inside the spawnchunks, or maybe running a chunkloader in general somehow stops DH from idling. Maybe due to some changes happening in the loaded area, DH is coninously trying to reprocess the handful of loaded chunks? Are you using chunk loaders as well by chance? That would add some weight to my theory
Puhpine
Puhpine2mo ago
Yeah it's probably constantly updating those chunks that are updated Can you turn them off?
MordorsElite
MordorsEliteOP2mo ago
Not on PC right now, but can try it later. Thing is that still seems excessive, to have 100% CPU usage for 9 loaded chunks. (It's only a chunk loader in the 3x3 spawn chunks)
Puhpine
Puhpine2mo ago
Yeah that's true And that wouldn't explain why it doesn't happen on a new server
Nightly
Nightly2mo ago
Not before yesterday
MordorsElite
MordorsEliteOP2w ago
The issue appears to be fully (or at least partially) solved with the latest update (2.3.2-b-1.21.4). When setting DH to "I paid for the whole CPU", it now no longer runs at 100% usage. When bots are online, there is a constant ebbing of activity with the server showing between 5 and 40% CPU usage. With no one online some spikes sill seem to be in evidence but they rarely seem to exceep 30% and most of the time the server lies between 0.1% and 10% usage. Since there still is idle usage, I'm not entirely sure if I should mark the issue as solved tho

Did you find this page helpful?