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.
No description
46 Replies
cityofj
cityofjOP7d ago
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"
Ramelstag
Ramelstag7d ago
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
majo24
majo247d ago
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.
cityofj
cityofjOP7d ago
How much should I pregen? I did 256 earlier today but I’m not sure what a good number would be
Ramelstag
Ramelstag7d ago
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
cityofj
cityofjOP7d ago
How do I Tweak it for the server?
Ramelstag
Ramelstag7d ago
manually tell it how many threads it can use but first you'd need to check if my theory is correct
cityofj
cityofjOP7d ago
I’m using a modrinth server.
cityofj
cityofjOP7d ago
No description
cityofj
cityofjOP7d ago
I’m not sure how to check if this is the case
Ramelstag
Ramelstag7d ago
great, that doesn't mean crap
cityofj
cityofjOP7d ago
The balanced preset should be the default right?
Ramelstag
Ramelstag7d ago
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 it
Ramelstag
Ramelstag7d ago
you also have one for presets too
No description
Ramelstag
Ramelstag7d ago
there's only these two settings, and the bottom one is untouched by the presets it seems
No description
cityofj
cityofjOP7d ago
.
No description
Ramelstag
Ramelstag7d ago
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
cityofj
cityofjOP7d ago
No description
Ramelstag
Ramelstag7d ago
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
cityofj
cityofjOP7d ago
ah. so i should lower that setting?
Ramelstag
Ramelstag7d ago
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
cityofj
cityofjOP7d ago
No description
Ramelstag
Ramelstag7d ago
this one
cityofj
cityofjOP7d ago
No description
Ramelstag
Ramelstag7d ago
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
cityofj
cityofjOP7d ago
done
Ramelstag
Ramelstag7d ago
now see how it will do
cityofj
cityofjOP7d ago
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?
cityofj
cityofjOP7d ago
No description
cityofj
cityofjOP7d ago
No description
Ramelstag
Ramelstag7d ago
no, it shouldn't need a restart
Ramelstag
Ramelstag7d ago
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
No description
Ramelstag
Ramelstag7d ago
and when you stop the pregen, does it stabilize at how much usage %?
cityofj
cityofjOP7d ago
it goes to 100. when i stop it, it drops to like 3%
Ramelstag
Ramelstag7d ago
yeah, that seems way too odd, i feel like that cpu usage meter is not reading stuff correctly
cityofj
cityofjOP7d ago
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
Ramelstag
Ramelstag7d ago
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
cityofj
cityofjOP7d ago
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
Skillnoob_
Skillnoob_6d ago
how many cores do you have configured for your server?
Fnige
Fnige6d ago
Oh yeah fun fact, its inaccurate as theyre using epyc cpus now lol
Ramelstag
Ramelstag6d ago
great
cityofj
cityofjOP6d ago
No description
cityofj
cityofjOP6d ago
No description
cityofj
cityofjOP6d ago
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
Skillnoob_
Skillnoob_6d ago
We recommend removing the -Xmx argument and instead relying on -XX:MaxRAMPercentage=95.0
it says it right there
cityofj
cityofjOP6d ago
my bad. it kept crashing when i did that but its working now. i must have messed it up somehow

Did you find this page helpful?