Recent Discussions
server running poorly
Unanswered
Gończy Polski posted this in #questions
139 messages
0 views
Gończy PolskiOP
running a better minecraft 4 server on an i5 10400f with 32 gb of ram with 6-10 players. I allocated 24 gb of ram to the server but it maxes out. do i need to buy more ram?
Original message was deleted
*taps the sign*
Read that and do what it says, specifically 2nd bullet.
Read that and do what it says, specifically 2nd bullet.
Gończy PolskiOP
Taking a look. Let's see what we got!
Post your run.sh and jvm_user_args.txt here.
@Gończy Polski
Gończy PolskiOP
should i paste the text or post the file
whatever is more convenient for you. The bot will upload it to mclo.gs either way.
Gończy PolskiOP
#!/usr/bin/env sh
# Forge requires a configured set of both JVM and program arguments.
# Add custom JVM arguments to the user_jvm_args.txt
# Add custom program arguments {such as nogui} to this file in the next line before the "$@" or
# pass them to this script directly
java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.20.1-47.3.12/unix_args.txt nogui "$@"
# Forge requires a configured set of both JVM and program arguments.
# Add custom JVM arguments to the user_jvm_args.txt
# Add custom program arguments {such as nogui} to this file in the next line before the "$@" or
# pass them to this script directly
java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.20.1-47.3.12/unix_args.txt nogui "$@"
Gończy PolskiOP
# Xmx and Xms set the maximum and minimum RAM usage, respectively.
# They can take any number, followed by an M or a G.
# M means Megabyte, G means Gigabyte.
# For example, to set the maximum to 3GB: -Xmx3G
# To set the minimum to 2.5GB: -Xms2500M
# A good default for a modded server is 4GB.
# Uncomment the next line to set it.
# -Xmx4G
-Xmx24G -Xms6G -XX:+UseZGC -XX:+AlwaysPreTouch -XX:MaxGCPauseMillis=200 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=20 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true
# They can take any number, followed by an M or a G.
# M means Megabyte, G means Gigabyte.
# For example, to set the maximum to 3GB: -Xmx3G
# To set the minimum to 2.5GB: -Xms2500M
# A good default for a modded server is 4GB.
# Uncomment the next line to set it.
# -Xmx4G
-Xmx24G -Xms6G -XX:+UseZGC -XX:+AlwaysPreTouch -XX:MaxGCPauseMillis=200 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=20 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true
@Gończy Polski # Xmx and Xms set the maximum and minimum RAM usage, respectively.
# They can take any number, followed by an M or a G.
# M means Megabyte, G means Gigabyte.
# For example, to set the maximum to 3GB: -Xmx3G
# To set the minimum to 2.5GB: -Xms2500M
# A good default for a modded server is 4GB.
# Uncomment the next line to set it.
# -Xmx4G
-Xmx24G -Xms6G -XX:+UseZGC -XX:+AlwaysPreTouch -XX:MaxGCPauseMillis=200 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=20 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true
# They can take any number, followed by an M or a G.
# M means Megabyte, G means Gigabyte.
# For example, to set the maximum to 3GB: -Xmx3G
# To set the minimum to 2.5GB: -Xms2500M
# A good default for a modded server is 4GB.
# Uncomment the next line to set it.
# -Xmx4G
-Xmx24G -Xms6G -XX:+UseZGC -XX:+AlwaysPreTouch -XX:MaxGCPauseMillis=200 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=20 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true
Okay, so first thing, you're doing bad things with your JVM flags. I see that you have mixed flag recommendations from multiple sources.
Go ahead and delete everything in that file, and use https://flags.sh to generate new flags.
Additionally, set your RAM usage to 12GB for both min and max.
Additionally, set your RAM usage to 12GB for both min and max.
-Xms12288M -Xmx12288M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15Should be like that
Delete everything in your user JVM args, put those in instead, restart server.
and then do another Spark.
(and before you ask, yes I know we're going down in ram)
Gończy PolskiOP
okay, better. making progress.
So before we move on, are you interested in learning WHY we just did that?
If not and you just want results, that's chill too.
Gończy PolskiOP
sure why not
Okay so
JVM flags can seem kinda magical to newbies. I totally get it.
But they do super specific things.
I could tell that you had been using "Aikar's flags", which are based on the G1 garbage collector, but switched to ZGC at some point.
Because there was a mix of flags.
So we had a bit of a chaotic state, and we needed to clean that up.
My first goal there was to get your flags to a known state as a starting point.
And that was back on G1GC / Aikar's Flags.
So that was half of it.
Second half was that you had 6GB of initial heap allocation and 20GB of maximum heap allocation.
Two problems here.
1. The JVM will only ACTUALLY reserve the initial allocation, the 6GB. So if the JVM tries to grow the heap, it COULD become unable to if something else on your PC took that memory first. This would cause a crash. Growing the JVM also requires CPU cycles to do, which loses performance.
2. The larger your allocated memory, the more CPU cycles a GC sweep with G1GC actually takes. It's like cleaning your closet. You know you want to throw away stuff you don't need. But you have to sort through it all, and the more shit in there, the longer it takes to finish. That's what the Garbage Collector is doing. More RAM means it takes more time.
2. The larger your allocated memory, the more CPU cycles a GC sweep with G1GC actually takes. It's like cleaning your closet. You know you want to throw away stuff you don't need. But you have to sort through it all, and the more shit in there, the longer it takes to finish. That's what the Garbage Collector is doing. More RAM means it takes more time.
So by bringing the initial allocation up from 6GB to 12GB and the max DOWN from 20GB to 12GB, we solve both issues at once.
## That brings us to now.
I'm seeing some improvements from those changes, but we are still having some issues. I also see this:
image.png
This is saying the Garbage Collector is having to sweep too frequently. That means that it could use more allocated RAM to work on data.
So now we increase by 2 GB up to 14GB, restart, take another Spark, and try again.
Gończy PolskiOP
theres still people currently playing on the server so i this might take a while and i dont really want to ask them to constantly log off so i can restart
@Gończy Polski theres still people currently playing on the server so i this might take a while and i dont really want to ask them to constantly log off so i can restart
Okay. So I can give you some instructions you can follow when it's convenient, if you'd like.
Just note that the Spark will be most accurate if you keep testing with folks playing on it, so inconveniencing them periodically while we sort this out might actually give better results.
Even so, I understand if you don't want to do that.
Just note that the Spark will be most accurate if you keep testing with folks playing on it, so inconveniencing them periodically while we sort this out might actually give better results.
Even so, I understand if you don't want to do that.
Loading...
Loading...