[Bug Report]: Proablems lag Server/Client
Closed this issue · 9 comments
Modpack Version
1.24.1
Describe your issue.
Olá, gostaria de reportar problemas com lag e baixo tps em um server recém criado. Já tive esse problema em versões anteriores também, e mesmo fazendo de tudo, não consigo achar uma solução.
Gostaria de uma ajuda para investigar e trazer uma solução, pois gosto muito do modpack e não queria parar de joga-lo
Algumas coisa já feitas foram alterar configurações de memoria e disco. A máquina tem 32GB de RAM e roda em um server alocado na empresa onde trabalho. Roda em um proxmox e já rodei outros mods como ATM10 e não tive o mesmo problema. Ja mudei configs de argumesnto do java e nada de resolver
Crash Report
No response
Latest Log
No response
Have you modified the modpack?
No
User Modifications
No response
Did the issue happen in singleplayer or on a server?
Singleplayer
Discord Username
Venerando#4273
check how much CPU is being used. run a spark profile and review the findings from it. Spark is in the modpack by default.
https://spark.lucko.me/docs/guides/TPS-and-MSPT
https://spark.lucko.me/docs/guides/The-tick-loop
https://spark.lucko.me/docs/guides/Finding-lag-spikes
Also, if you are not using the official server pack from curseforge and running the server using the provided startserver.sh script, be sure to use the official server starter and set your java arguments in the yaml file
check how much CPU is being used. run a spark profile and review the findings from it. Spark is in the modpack by default.
https://spark.lucko.me/docs/guides/TPS-and-MSPT
https://spark.lucko.me/docs/guides/The-tick-loop
https://spark.lucko.me/docs/guides/Finding-lag-spikes
Obrigado pelo retorno!
https://spark.lucko.me/zQFL1hDcVx como pode ver, o uso é bem baixo dos recursos (CPU/RAM)

Além disso, se você não estiver usando o pacote de servidor oficial do curseforge e executando o servidor usando o script startserver.sh fornecido, certifique-se de usar o iniciador de servidor oficial e definir seus argumentos Java no arquivo yaml
Obrigado pelo retorno!
Estou utilizando pacote official do curseforge, apenas alterei o args para haver mais recursos.
server-setup-config.yaml
launch:
specifies the max amount of ram the server is supposed to launch with (Xmx)
maxRam: 10G
specifies the minimal amount of ram the server is supposed to launch with (Xms)
minRam: 10G
specifies whether the server is supposed to auto restart after crash
autoRestart: false
javaArgs:
- "-XX:+UseG1GC"
you have 8 cores and are spending most time on entity ticks (skeletons, endermen, etc)
your CPU is fairly weak, and appears to be having trouble processing all of the mobs that are spawned. you can try adding something like servercore to reduce the simulation distance and such as load increases.
you can see the TPS drops heavily when the entity count goes up (notice the TPS became much higher when the one player logged off and the chunks and entities they were loading were unloaded)

If your players are using spawner mobfarms or animal crushing farms, i would recommend moving to something like ars drygmy farms as they dont require mobs to calculate collision and movement each tick
you can use Meowice's flags for mc by adding them in the args section:
launch:
# specifies the max amount of ram the server is supposed to launch with (Xmx)
maxRam: 10G
# specifies the minimal amount of ram the server is supposed to launch with (Xms)
minRam: 10G
# specifies whether the server is supposed to auto restart after crash
autoRestart: false
javaArgs:
- "-XX:+UseG1GC"
- "-XX:+IgnoreUnrecognizedVMOptions"
- "-XX:+ParallelRefProcEnabled"
- "-XX:MaxGCPauseMillis=200"
- "-XX:+UnlockExperimentalVMOptions"
- "-XX:+DisableExplicitGC"
- "-XX:+AlwaysPreTouch"
- "-XX:G1NewSizePercent=28"
- "-XX:G1MaxNewSizePercent=50"
- "-XX:G1HeapRegionSize=16M"
- "-XX:G1ReservePercent=15"
- "-XX:G1HeapWastePercent=5"
- "-XX:G1MixedGCCountTarget=3"
- "-XX:InitiatingHeapOccupancyPercent=20"
- "-XX:G1MixedGCLiveThresholdPercent=90"
- "-XX:G1RSetUpdatingPauseTimePercent=0"
- "-XX:SurvivorRatio=32"
- "-XX:+PerfDisableSharedMem"
- "-XX:MaxTenuringThreshold=1"
- "-XX:+UnlockDiagnosticVMOptions"
- "-XX:+UnlockExperimentalVMOptions"
- "-XX:G1SATBBufferEnqueueingThresholdPercent=30"
- "-XX:G1ConcMarkStepDurationMillis=5"
- "-XX:+UseNUMA"
- "-XX:-DontCompileHugeMethods"
- "-XX:MaxNodeLimit=240000"
- "-XX:NodeLimitFudgeFactor=8000"
- "-XX:ReservedCodeCacheSize=400M"
- "-XX:NonNMethodCodeHeapSize=12M"
- "-XX:ProfiledCodeHeapSize=194M"
- "-XX:NonProfiledCodeHeapSize=194M"
- "-XX:NmethodSweepActivity=1"
- "-XX:+UseFastUnorderedTimeStamps"
- "-XX:+UseCriticalJavaThreadPriority"
- "-XX:AllocatePrefetchStyle=3"
- "-XX:+AlwaysActAsServerClassMachine"
- "-XX:+UseTransparentHugePages"
- "-XX:LargePageSizeInBytes=2M"
- "-XX:+UseLargePages"
- "-XX:+EagerJVMCI"
- "-XX:+UseStringDeduplication"
- "-XX:+UseAES"
- "-XX:+UseAESIntrinsics"
- "-XX:+UseFMA"
- "-XX:+UseLoopPredicate"
- "-XX:+RangeCheckElimination"
- "-XX:+OptimizeStringConcat"
- "-XX:+UseCompressedOops"
- "-XX:+UseThreadPriorities"
- "-XX:+OmitStackTraceInFastThrow"
- "-XX:+RewriteBytecodes"
- "-XX:+RewriteFrequentPairs"
- "-XX:+UseFPUForSpilling"
- "-XX:+UseVectorCmov"
- "-XX:+UseXMMForArrayCopy"
- "-XX:+EliminateLocks"
- "-XX:+DoEscapeAnalysis"
- "-XX:+AlignVector"
- "-XX:+OptimizeFill"
- "-XX:+EnableVectorSupport"
- "-XX:+UseCharacterCompareIntrinsics"
- "-XX:+UseCopySignIntrinsic"
- "-XX:+UseVectorStubs"
spongefix: false
You can also try using graalvm Java 24/25 instead of Java 21 and adding graalvm specific flags:
launch:
# specifies the max amount of ram the server is supposed to launch with (Xmx)
maxRam: 5G
# specifies the minimal amount of ram the server is supposed to launch with (Xms)
minRam: 3G
# specifies whether the server is supposed to auto restart after crash
autoRestart: false
javaArgs:
- "-XX:+UseG1GC"
- "-XX:+IgnoreUnrecognizedVMOptions"
- "-XX:+ParallelRefProcEnabled"
- "-XX:MaxGCPauseMillis=200"
- "-XX:+UnlockExperimentalVMOptions"
- "-XX:+DisableExplicitGC"
- "-XX:+AlwaysPreTouch"
- "-XX:G1NewSizePercent=28"
- "-XX:G1MaxNewSizePercent=50"
- "-XX:G1HeapRegionSize=16M"
- "-XX:G1ReservePercent=15"
- "-XX:G1HeapWastePercent=5"
- "-XX:G1MixedGCCountTarget=3"
- "-XX:InitiatingHeapOccupancyPercent=20"
- "-XX:G1MixedGCLiveThresholdPercent=90"
- "-XX:G1RSetUpdatingPauseTimePercent=0"
- "-XX:SurvivorRatio=32"
- "-XX:+PerfDisableSharedMem"
- "-XX:MaxTenuringThreshold=1"
- "-XX:+UnlockDiagnosticVMOptions"
- "-XX:+UnlockExperimentalVMOptions"
- "-XX:G1SATBBufferEnqueueingThresholdPercent=30"
- "-XX:G1ConcMarkStepDurationMillis=5"
- "-XX:+UseNUMA"
- "-XX:-DontCompileHugeMethods"
- "-XX:MaxNodeLimit=240000"
- "-XX:NodeLimitFudgeFactor=8000"
- "-XX:ReservedCodeCacheSize=400M"
- "-XX:NonNMethodCodeHeapSize=12M"
- "-XX:ProfiledCodeHeapSize=194M"
- "-XX:NonProfiledCodeHeapSize=194M"
- "-XX:NmethodSweepActivity=1"
- "-XX:+UseFastUnorderedTimeStamps"
- "-XX:+UseCriticalJavaThreadPriority"
- "-XX:AllocatePrefetchStyle=3"
- "-XX:+AlwaysActAsServerClassMachine"
- "-XX:+UseTransparentHugePages"
- "-XX:LargePageSizeInBytes=2M"
- "-XX:+UseLargePages"
- "-XX:+EagerJVMCI"
- "-XX:+UseStringDeduplication"
- "-XX:+UseAES"
- "-XX:+UseAESIntrinsics"
- "-XX:+UseFMA"
- "-XX:+UseLoopPredicate"
- "-XX:+RangeCheckElimination"
- "-XX:+OptimizeStringConcat"
- "-XX:+UseCompressedOops"
- "-XX:+UseThreadPriorities"
- "-XX:+OmitStackTraceInFastThrow"
- "-XX:+RewriteBytecodes"
- "-XX:+RewriteFrequentPairs"
- "-XX:+UseFPUForSpilling"
- "-XX:+UseVectorCmov"
- "-XX:+UseXMMForArrayCopy"
- "-XX:+EliminateLocks"
- "-XX:+DoEscapeAnalysis"
- "-XX:+AlignVector"
- "-XX:+OptimizeFill"
- "-XX:+EnableVectorSupport"
- "-XX:+UseCharacterCompareIntrinsics"
- "-XX:+UseCopySignIntrinsic"
- "-XX:+UseVectorStubs"
- "-XX:+UseFastJNIAccessors"
- "-XX:+UseInlineCaches"
- "-XX:+SegmentedCodeCache"
- "-Djdk.nio.maxCachedBufferSize=262144"
- "-Djdk.graal.UsePriorityInlining=true"
- "-Djdk.graal.Vectorization=true"
- "-Djdk.graal.OptDuplication=true"
- "-Djdk.graal.DetectInvertedLoopsAsCounted=true"
- "-Djdk.graal.LoopInversion=true"
- "-Djdk.graal.VectorizeHashes=true"
- "-Djdk.graal.EnterprisePartialUnroll=true"
- "-Djdk.graal.VectorizeSIMD=true"
- "-Djdk.graal.StripMineNonCountedLoops=true"
- "-Djdk.graal.SpeculativeGuardMovement=true"
- "-Djdk.graal.TuneInlinerExploration=1"
- "-Djdk.graal.LoopRotation=true"
- "-Djdk.graal.CompilerConfiguration=enterprise"
- "--enable-native-access=ALL-UNNAMED"
spongefix: false
você tem 8 núcleos e está gastando a maior parte do tempo em ticks de entidade (esqueletos, endermen, etc) sua CPU é bastante fraca e parece estar tendo problemas para processar todos os mobs que são gerados. Você pode tentar adicionar algo como servercore para reduzir a distância de simulação e aumentos de carga.
você pode ver que o TPS cai muito quando a contagem de entidades aumenta (observe que o TPS se tornou muito maior quando um jogador se desconectou e os pedaços e entidades que eles estavam carregando foram descarregados)
![]()
ServerCore para a versão do minecraft do modpack não esta disponivel para NeoForge e fiz a instalção do Lithium. Farms tem algumas sendo utilizadas para pegar XP, mas há outros modos que podemos fazer para melhorar a performace.
Resultado me agragou no resultado
você pode usar as bandeiras do Meowice para mc adicionando-as na seção args:
launch: # specifies the max amount of ram the server is supposed to launch with (Xmx) maxRam: 10G # specifies the minimal amount of ram the server is supposed to launch with (Xms) minRam: 10G # specifies whether the server is supposed to auto restart after crash autoRestart: false javaArgs: - "-XX:+UseG1GC" - "-XX:+IgnoreUnrecognizedVMOptions" - "-XX:+ParallelRefProcEnabled" - "-XX:MaxGCPauseMillis=200" - "-XX:+UnlockExperimentalVMOptions" - "-XX:+DisableExplicitGC" - "-XX:+AlwaysPreTouch" - "-XX:G1NewSizePercent=28" - "-XX:G1MaxNewSizePercent=50" - "-XX:G1HeapRegionSize=16M" - "-XX:G1ReservePercent=15" - "-XX:G1HeapWastePercent=5" - "-XX:G1MixedGCCountTarget=3" - "-XX:InitiatingHeapOccupancyPercent=20" - "-XX:G1MixedGCLiveThresholdPercent=90" - "-XX:G1RSetUpdatingPauseTimePercent=0" - "-XX:SurvivorRatio=32" - "-XX:+PerfDisableSharedMem" - "-XX:MaxTenuringThreshold=1" - "-XX:+UnlockDiagnosticVMOptions" - "-XX:+UnlockExperimentalVMOptions" - "-XX:G1SATBBufferEnqueueingThresholdPercent=30" - "-XX:G1ConcMarkStepDurationMillis=5" - "-XX:+UseNUMA" - "-XX:-DontCompileHugeMethods" - "-XX:MaxNodeLimit=240000" - "-XX:NodeLimitFudgeFactor=8000" - "-XX:ReservedCodeCacheSize=400M" - "-XX:NonNMethodCodeHeapSize=12M" - "-XX:ProfiledCodeHeapSize=194M" - "-XX:NonProfiledCodeHeapSize=194M" - "-XX:NmethodSweepActivity=1" - "-XX:+UseFastUnorderedTimeStamps" - "-XX:+UseCriticalJavaThreadPriority" - "-XX:AllocatePrefetchStyle=3" - "-XX:+AlwaysActAsServerClassMachine" - "-XX:+UseTransparentHugePages" - "-XX:LargePageSizeInBytes=2M" - "-XX:+UseLargePages" - "-XX:+EagerJVMCI" - "-XX:+UseStringDeduplication" - "-XX:+UseAES" - "-XX:+UseAESIntrinsics" - "-XX:+UseFMA" - "-XX:+UseLoopPredicate" - "-XX:+RangeCheckElimination" - "-XX:+OptimizeStringConcat" - "-XX:+UseCompressedOops" - "-XX:+UseThreadPriorities" - "-XX:+OmitStackTraceInFastThrow" - "-XX:+RewriteBytecodes" - "-XX:+RewriteFrequentPairs" - "-XX:+UseFPUForSpilling" - "-XX:+UseVectorCmov" - "-XX:+UseXMMForArrayCopy" - "-XX:+EliminateLocks" - "-XX:+DoEscapeAnalysis" - "-XX:+AlignVector" - "-XX:+OptimizeFill" - "-XX:+EnableVectorSupport" - "-XX:+UseCharacterCompareIntrinsics" - "-XX:+UseCopySignIntrinsic" - "-XX:+UseVectorStubs" spongefix: falseVocê também pode tentar usar o graalvm Java 24/25 em vez do Java 21 e adicionar sinalizadores específicos do graalvm:
launch: # specifies the max amount of ram the server is supposed to launch with (Xmx) maxRam: 5G # specifies the minimal amount of ram the server is supposed to launch with (Xms) minRam: 3G # specifies whether the server is supposed to auto restart after crash autoRestart: false javaArgs: - "-XX:+UseG1GC" - "-XX:+IgnoreUnrecognizedVMOptions" - "-XX:+ParallelRefProcEnabled" - "-XX:MaxGCPauseMillis=200" - "-XX:+UnlockExperimentalVMOptions" - "-XX:+DisableExplicitGC" - "-XX:+AlwaysPreTouch" - "-XX:G1NewSizePercent=28" - "-XX:G1MaxNewSizePercent=50" - "-XX:G1HeapRegionSize=16M" - "-XX:G1ReservePercent=15" - "-XX:G1HeapWastePercent=5" - "-XX:G1MixedGCCountTarget=3" - "-XX:InitiatingHeapOccupancyPercent=20" - "-XX:G1MixedGCLiveThresholdPercent=90" - "-XX:G1RSetUpdatingPauseTimePercent=0" - "-XX:SurvivorRatio=32" - "-XX:+PerfDisableSharedMem" - "-XX:MaxTenuringThreshold=1" - "-XX:+UnlockDiagnosticVMOptions" - "-XX:+UnlockExperimentalVMOptions" - "-XX:G1SATBBufferEnqueueingThresholdPercent=30" - "-XX:G1ConcMarkStepDurationMillis=5" - "-XX:+UseNUMA" - "-XX:-DontCompileHugeMethods" - "-XX:MaxNodeLimit=240000" - "-XX:NodeLimitFudgeFactor=8000" - "-XX:ReservedCodeCacheSize=400M" - "-XX:NonNMethodCodeHeapSize=12M" - "-XX:ProfiledCodeHeapSize=194M" - "-XX:NonProfiledCodeHeapSize=194M" - "-XX:NmethodSweepActivity=1" - "-XX:+UseFastUnorderedTimeStamps" - "-XX:+UseCriticalJavaThreadPriority" - "-XX:AllocatePrefetchStyle=3" - "-XX:+AlwaysActAsServerClassMachine" - "-XX:+UseTransparentHugePages" - "-XX:LargePageSizeInBytes=2M" - "-XX:+UseLargePages" - "-XX:+EagerJVMCI" - "-XX:+UseStringDeduplication" - "-XX:+UseAES" - "-XX:+UseAESIntrinsics" - "-XX:+UseFMA" - "-XX:+UseLoopPredicate" - "-XX:+RangeCheckElimination" - "-XX:+OptimizeStringConcat" - "-XX:+UseCompressedOops" - "-XX:+UseThreadPriorities" - "-XX:+OmitStackTraceInFastThrow" - "-XX:+RewriteBytecodes" - "-XX:+RewriteFrequentPairs" - "-XX:+UseFPUForSpilling" - "-XX:+UseVectorCmov" - "-XX:+UseXMMForArrayCopy" - "-XX:+EliminateLocks" - "-XX:+DoEscapeAnalysis" - "-XX:+AlignVector" - "-XX:+OptimizeFill" - "-XX:+EnableVectorSupport" - "-XX:+UseCharacterCompareIntrinsics" - "-XX:+UseCopySignIntrinsic" - "-XX:+UseVectorStubs" - "-XX:+UseFastJNIAccessors" - "-XX:+UseInlineCaches" - "-XX:+SegmentedCodeCache" - "-Djdk.nio.maxCachedBufferSize=262144" - "-Djdk.graal.UsePriorityInlining=true" - "-Djdk.graal.Vectorization=true" - "-Djdk.graal.OptDuplication=true" - "-Djdk.graal.DetectInvertedLoopsAsCounted=true" - "-Djdk.graal.LoopInversion=true" - "-Djdk.graal.VectorizeHashes=true" - "-Djdk.graal.EnterprisePartialUnroll=true" - "-Djdk.graal.VectorizeSIMD=true" - "-Djdk.graal.StripMineNonCountedLoops=true" - "-Djdk.graal.SpeculativeGuardMovement=true" - "-Djdk.graal.TuneInlinerExploration=1" - "-Djdk.graal.LoopRotation=true" - "-Djdk.graal.CompilerConfiguration=enterprise" - "--enable-native-access=ALL-UNNAMED" spongefix: false
Utilizei esses argumentos para ver como ficou, no momento há 3 online e quase não oscila mais o TPS https://spark.lucko.me/7EqBDzBiyV. Mas caso precisar sigo a orientação graalvm
Resultado esta bem satisfatório.
