Server crashing when flying (usually over new chunks)

This is partially answered in the FAQ but I just want full clarity on the entire situation and also perhaps any recommendations. When flying (90% of the time over new chunks) the server often lags heavily behind, and then crashes. Most likely just due to the server not being able to handle it, fair enough. Whilst LODs are present and are already loaded (due to the mod being on the server) they often fade out when trying to land and the server has to catch up and generate the actual real chunks. I ran the spark mod and the culprit was mainly DH so I removed that and the server runs fine now when flying around, still a little slow sometimes to load chunks but doesn't drop below 19 TPS. The confusing thing is the LODs are already loaded and there, for a decent size around our main play area even for areas we've never been (according to the loaded chunks show on BlueMap), so I would assume the server just needs to load the actual chunks and DH can rest easy since they already exist. Maybe its regrabbing them in case of anything new like buildings etc. Regardless, removing the mod from the server fixed it and clients still see as far as the eye can see with all the LODs previously synced. My main question, does the DH pregenerator only generate LODs? as I dont want to pregen actual chunks causing them to show up on BlueMap (we like seeing where we've explored or not). And if it does only gen LODs can I pregen a bunch when no one is on, have the mod present when everyone jumps on and let them all sync up, and then remove the mod? I understand future LODs far far away outside the generated area will not generate until we explore them, i can always gen more later using this same process, but thats not going to be for a while. I also understand any structure changes like someone building wont show up until I load them with the mod removed, its just me and a friend and we mostly stick together. Secondary question, is the potential issue because DH is trying to send updated LODs?
Solution:
You can generate the area you want on the server, then offer the players a download for the DH database file
Jump to solution
74 Replies
Jckf
Jckf5mo ago
Default settings will generate LODs only, not chunks. For the best performance when flying around, pregen both chunks and LODs. You can define a border that stops DH from generating further than some set limit
Computurtle
ComputurtleOP5mo ago
Ok good to know, is there a way to sync the servers LODs (beyond a clients DH distant) to the clients to then remove the mod? Only issue with pregen chunks is it will show up in BlueMap which we are avoiding. Flying into new chunks without the mod is no issue, but even flying in generated chunks with DH sometimes caused server to die
Solution
Jckf
Jckf5mo ago
You can generate the area you want on the server, then offer the players a download for the DH database file
Computurtle
ComputurtleOP5mo ago
Oh thats not a bad idea Just drag and replace the current DH database file for the server on the client end?
Jckf
Jckf5mo ago
Yup
Computurtle
ComputurtleOP5mo ago
Ok that could work 🙂 thanks
Jckf
Jckf5mo ago
Assuming your server is using the mod and not the plugin. The two have different database formats
Computurtle
ComputurtleOP5mo ago
Mod 🙂 fabric
Jckf
Jckf5mo ago
👍
Computurtle
ComputurtleOP5mo ago
Ok, ill consider this solved, but do you know if DH still tries to send/regenerate new LODs even if they are already present? I assume so to update any built structures. Cause thats where I think the server struggles aha
Jckf
Jckf5mo ago
DH will only regenerate an existing LOD if changes are detected in the region files
Computurtle
ComputurtleOP5mo ago
is this a set limit from an origin point or around the player? like it wont send more than X radius no matter what the clients radius is set to
Jckf
Jckf5mo ago
You set a center and a radius, just like you would with a worldborder
Computurtle
ComputurtleOP5mo ago
Hmmm interesting. Not sure what the issue is then. Since removing the mod on the server stopped any issues. Cause it would mostly happen in generated LODs but ungenerated chunks, so LODs shouldnt have any updates since they are untouched
Jckf
Jckf5mo ago
It sounds to me like your server has enough capacity to generate either chunks or LODs individually, but noth both at the same time. Exactly which position the player is in during the crash is probably not as relevant as the size of the ungenerated area around them
Computurtle
ComputurtleOP5mo ago
Yeah thats what I was thinking too. I could try lowering the render distance serverside but if your flying high speed that probably doesnt matter ahaha
Jckf
Jckf5mo ago
You can also lower DH's request concurrency limit, which will prevent players from requesting as many LODs in parallel
Computurtle
ComputurtleOP5mo ago
But the LODs already being present doesnt make sense, maybe its trying to generate them far far away, since those probably arent Might give that a shot, might be good middle ground Thank you for all your help, super appreciate it!
Jckf
Jckf5mo ago
No worries :) There are a lot of settings in DH you can adjust to tune the performance I recommend reading through the config file, as there are a lot of comments in there that explain what everything does
Computurtle
ComputurtleOP5mo ago
Yeah looking now, superb config, others should be just like this aha
Jckf
Jckf5mo ago
There's even a CPU preset setting that lowers or increases the number of threads used Haha I guess it makes more sense to lower the CPU preset before adjusting the request concurrency limit now that I think about it
Computurtle
ComputurtleOP5mo ago
# How many LOD generation requests per second should a client send?
# Also limits the number of client requests allowed to stay in the server's queue.
generationRequestRateLimit = 20
#
# How many LOD sync requests per second should a client send?
# Also limits the amount of player's requests allowed to stay in the server's queue.
syncOnLoadRateLimit = 50
# How many LOD generation requests per second should a client send?
# Also limits the number of client requests allowed to stay in the server's queue.
generationRequestRateLimit = 20
#
# How many LOD sync requests per second should a client send?
# Also limits the amount of player's requests allowed to stay in the server's queue.
syncOnLoadRateLimit = 50
So these two yeah? 20/sec is probably a lot, 50 is probably fine cause thats just for already generated ones
Jckf
Jckf5mo ago
Correct
Computurtle
ComputurtleOP5mo ago
Alrighty, ill fiddle around with these and see if i can find a sweet spot SO minecraft is single threaded right, if my server is running 4 cores (through proxmox, with unlimited use in pterodactyl) 3 threads is safe?
Jckf
Jckf5mo ago
That's a bit of a complex question, and will depend on your server software and other mods too. You can often still see performance gains when increasing the thread count past the core count, but it's all very individual
Computurtle
ComputurtleOP5mo ago
ok ok noted, another one to fiddle with
Jckf
Jckf5mo ago
But I get what you're aiming for: Always leave at least 1 core free for the main thread, right?
Computurtle
ComputurtleOP5mo ago
Thats the plan aha but yeh this isnt a heavily modded server, but I think there is some mods that also like running on a seperate thread threadRunTimeRatio = "1.0" this is the percentage one your were talking about yeah?
Jckf
Jckf5mo ago
I am not too familiar with that one. I mainly work on the plugin 🙈
Computurtle
ComputurtleOP5mo ago
All good, only option that sounds like it would be
# A value between 1.0 and 0.0 that represents the percentage
# of time each thread can run before going idle.
#
# This can be used to reduce CPU usage if the thread count
# is already set to 1 for the given option, or more finely
# tune CPU performance.
threadRunTimeRatio = "1.0"
# A value between 1.0 and 0.0 that represents the percentage
# of time each thread can run before going idle.
#
# This can be used to reduce CPU usage if the thread count
# is already set to 1 for the given option, or more finely
# tune CPU performance.
threadRunTimeRatio = "1.0"
Jckf
Jckf5mo ago
Where did I talk about a percentage setting?
Computurtle
ComputurtleOP5mo ago
nevermind im trippin, you did mention threads
Jckf
Jckf5mo ago
Ah, so that sounds like you can command it to only use say 70% of each core
Computurtle
ComputurtleOP5mo ago
Either way ill let you free now aha, ill play around with the settings Whats the worst that could happen
Computurtle
ComputurtleOP5mo ago
:KEKW:
Jckf
Jckf5mo ago
Feel free to ping me again if you have more questions. I don't know everything, but might be able to point you in the right direction or involve someone else who knows
Computurtle
ComputurtleOP5mo ago
Legends I'll be honest, I was worried that the whole process of forcing the user to read the FAQ to validate would mean staff would be uptight douches who make you feel stupid for not knowing inner workings of a complicated mod, but you proved me wrong! A+ support 😛
Jckf
Jckf5mo ago
Hahah :D Thanks! We got a lot of the same questions over and over, which is why we have that whole process set up
Computurtle
ComputurtleOP5mo ago
Oh dont get me wrong, its a great system aha. Reminds me of those big companies who refuse to put you through to an agent without first reading relevant documents
Jckf
Jckf5mo ago
Haha, as a user though; those are horrible But I get it
Computurtle
ComputurtleOP5mo ago
Also, setting request/s to 10 (instead of 20) and changing the RunTimeRatio to 0.8 (instead of 1.0) seems to have fixed the crashing (at least with just me on) Will do more rigorous testing but seems like ill be able to nail in a sweet spot That coupled with pregen a massive LOD radius now, should mostly fix the issues, without needing to remove this mod 🙂 Hey @Jckf (GMT+2) sorry for the ping, but you have context for this (assuming you remember this ahaha) Im still having issues with lag Now I tried getting some help in the Spark discord cause i thought I fixed the issue by lowering some settings, thought maybe it was some other mod But after some deducing and hair pulling, disabling DH on the server pretty much negated any lag I was having Ok, so whats new? well using the spark profiler I was able to see that it seems DH was do some database requests or something which was causing the lag
Computurtle
ComputurtleOP5mo ago
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Computurtle
ComputurtleOP5mo ago
Now as stated before, I pregenerated i think it was 550 chunks radius around the base (where I was flying and got this profile) My client distance is 256 and none of the chunks should be changed so DH on the server should be able to just sit back and relax, but its not? Any ideas?
Computurtle
ComputurtleOP5mo ago
This crash report might help This might just be a case of, server aint big enough for the both of us lol. And I will have to remove DH, just sucks cause any LODs not synced now will have to be loaded by flying over them etc, and LOD updates wont happen. 1st world problems amirite whoopsie
Jckf
Jckf5mo ago
The Spark trace you are showing shows that 13% of a single thread is being taken up by "DB.prepare()". This is a method that prepares a SQL query for execution against the database. Re-preparing the same queries over and over is inoptimal, but since the code is running on a separate thread it should not cause any lag.
Computurtle
ComputurtleOP5mo ago
basically I just said DH try access my HDD, my HDD slow, probably the issue. Tinkered with settings to lower them even more, maybe fixed Guy on spark reckons DH is trying to do SQLite things on the main thread, but I cant read these things anyway lol
Jckf
Jckf5mo ago
And yeah, that crash log was caused by a watchdog timeout, which means it didn't actually crash - but took too long to complete some task
Computurtle
ComputurtleOP5mo ago
Yeah, usually around 20sec Either way I think this issue is beyond just optimising, unless these new lower settings do work lol, will see. Probably need a faster disk if its a database thing
Jckf
Jckf5mo ago
Ah, I didn't recognize this as happening on the main thread; but that might be. If so it's a case for @пшш or @BackSun
Computurtle
ComputurtleOP5mo ago
I turned the settings from 2 cores to 1, idk if thats stopping it from running on the main thread lol. It seems slightly more stable but I said that last time lol
Jckf
Jckf5mo ago
Whatever is happening on the main thread is probably still happening there, but you might have slowed it down enough to not notice it
Computurtle
ComputurtleOP5mo ago
Yeah thats my hope, have to give it a day or two to know for sure lol Disabling DH on the server caused everything to run really smooth, but alas I want to try and avoid that aha
BackSun
BackSun5mo ago
I remember there being some sql queries happening on the server thread that probably shouldn’t be, but that’s probably a better question for pshsh. I’m more familiar with the single player code.
Computurtle
ComputurtleOP5mo ago
Welp until the right person is able to take a look aha, ill see how these settings go and report back in a day or two, im off to bed 😛
Jckf
Jckf5mo ago
getTimestampForPos() it seems
Computurtle
ComputurtleOP5mo ago
Hope those profiles help 🙂
Jckf
Jckf5mo ago
Pshsh is probably asleep rn, but is usually up pretty early. I'll bug him again tomorrow if we don't see a response ;p
Computurtle
ComputurtleOP5mo ago
Cool cool, no rush
Computurtle
ComputurtleOP5mo ago
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Computurtle
ComputurtleOP5mo ago
Also here is profile for new DH config (1 core, 1.0 ratio, before it was 2 cores, 0.85 or something) The first 5-10 minutes I was flying around (where the lines go wonky lol) Doesnt seem to be having the same SQL task choking the server, just regular minecraft stuff
Jckf
Jckf5mo ago
Depending on your server software, you could also try the DH plugin
Computurtle
ComputurtleOP5mo ago
Where can i find that? That wouldnt work on a Fabric server tho would it?
Jckf
Jckf5mo ago
No, you would have to run Arclight or something similar There are links in #links-n-downloads though, at the bottom Arclight and Banner are the two Fabric+Bukkit softwares I know of
Computurtle
ComputurtleOP5mo ago
Hmm, might look into it. Ill give this some time first
пшш
пшш5mo ago
Yeah i completely forgot about that thing should be trivial to fix, will do when i have time I think database should be guarded to run only on its own threads
Puhpine
Puhpine5mo ago
(these were not very stable with DH and other mods/plugins when I tested it for the DH SMP, so I don´t recommend using it)
Computurtle
ComputurtleOP5mo ago
Noted, I'll patiently wait for the database thread fix then 🙂
пшш
пшш5mo ago
check the next build when it finishes
Computurtle
ComputurtleOP5mo ago
:bingodance: :bingodance: :bingodance: :bingodance: Where should I look? On modrinth or the git page directly
BackSun
BackSun5mo ago
Nightly builds in #links-n-downloads
Computurtle
ComputurtleOP5mo ago
Sweet

Did you find this page helpful?