CPU usage
Will the CPU usage always be at 100 for my server? Installed DH earlier today and it seems to be working but I'm worried about the CPU usage. I figured it would drop after a while. Memory usage is high and it drops when restarting the server but it steadily increases.

46 Replies
I saw that on the FAQ it reccomends "removing the -Xmx argument and instead relying on -XX:MaxRAMPercentage=95.0" but im not sure what that would look like. My current startup command is "java -Dterminal.jline=false -Dterminal.ansi=true -Xms512M -Xmx8192M -jar fabric-loader-1.20.1-0.16.9.jar --nogui"
you can tweak how much dh will hog the cpu
the preset that uses all the cpu is most likely not the default
it's probably balanced which is half of the cpu i think
I recommend you let the server pregen LODs through the night using the
/dh pregen
command so the server doesn't have to generate any new LODs while you're actually playing.How much should I pregen? I did 256 earlier today but I’m not sure what a good number would be
it's possible that like, the cpu presets are using more threads than what the cpu actually has, because, it's likely that they have like, 2 or 4 minecraft servers running on one physical unit, and then they divide how much cpu the servers can use, and then like, the balanced preset for example would actually equate to the whole server's cpu slice
How do I Tweak it for the server?
manually tell it how many threads it can use
but first you'd need to check if my theory is correct
I’m using a modrinth server.

I’m not sure how to check if this is the case
great, that doesn't mean crap
The balanced preset should be the default right?
ugh, why do these services ALWAYS fail to give useful information
yeah, which is half of the cpu i think
how about this
dh config threading.numberOfThreads
this is the command to change how many threads it will use
and if you just enter that on the server terminal with nothing else it will print the current value
dh config threading.numberOfThreads <number of desired threads>
to change ityou also have one for presets too

there's only these two settings, and the bottom one is untouched by the presets it seems

.

like, seriously, i can't stress this enough, just saying ryzen 7 or ryzen 9 could mean a 1000 series ryzen 7 or a 9000 series one
yeah, don't worry about the weird characters
these are supposed to make the text in-game have color
it has 2 threads set
see what
dh config common.threadPreset
says
yeah, the server definitely has a slice of a cpu, and not a whole cpu for itself, if im correct about the balanced preset being exactly half of the threads, this server only has 4 threads given to it
ah. so i should lower that setting?
hold on, just to check, set it to the max preset,
dh config common.threadPreset I_PAID_FOR_THE_WHOLE_CPU
and then print the number of threads again
this one

yeah, seems to only be 4 threads
so at balanced it should theoretically be only using 50% of the cpu
unless the rest of the game is using that other 50%, this doesn't add up
set it to 1 thread with
dh config threading.numberOfThreads 1
done
now see how it will do
cpu usage still stuck at 100. I will say i dont notice any lag. Do i have to restart the server for the command to take effect?


no, it shouldn't need a restart
im running pregen on a server on my computer rn and i gave it 3 threads out of my 6 thread cpu, and it does stabilize around 50% pretty well

and when you stop the pregen, does it stabilize at how much usage %?
it goes to 100. when i stop it, it drops to like 3%
yeah, that seems way too odd, i feel like that cpu usage meter is not reading stuff correctly
I figured something is off. Do you think the server would be lagging if the cpu was constantly at 100%? It still runs very smooth
it is likely that it would lag
like, when you're playing singleplayer the game sure as heck will slow down and stutter when the cpu gets pinned, so yeah
Yeah so it’s strange. Runs as smooth as butter. Perhaps I should wait until I run into any issues than hinder gameplay
I will probably end up building or buying a cheap server soon anyways
how many cores do you have configured for your server?
Oh yeah fun fact, its inaccurate as theyre using epyc cpus now lol
great


does anyone know exactly how that command is supposed to look like? do i replace everything or just a certain section? this iw hat it looks like by default
We recommend removing the -Xmx argument and instead relying on -XX:MaxRAMPercentage=95.0it says it right there
my bad. it kept crashing when i did that but its working now. i must have messed it up somehow