Purpur server TPS collapses, add.AdditionalSaveData wrecking havoc
The server runs on a dedicated machine, CPU and RAM more than enough but it is somehow bottlenecking itself to oblivion. And it appears the blame is as it shows on the screenshot.
Running at about 1 per ms, by 20 of these calls its 1 tick, this is happening with EVERY mob that spawns.
I can't find where is this coming from, it shows it may be a datapack, but none of the datapacks edit mobs now, which is whats causing the tps drops.
Can someone provide some guidance? Brain is melting after trying literally everything and been unable to find discussions with this problem elsewhere.
![No description](https://cdn.answeroverflow.com/1277365716684636272/purpur-server-tps-collapses-despite-barely-using-the-v0-zqs8q4oydvkd1.png)
77 Replies
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close
!close
!solved
!answered
Requested by thebacon.#0
send the spark :/
https://spark.lucko.me/cScQIzuCs7
here it is
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Spark Profile Analysis
These are not magic values. Many of these settings have real consequences on your server's mechanics. See this guide for detailed information on the functionality of each setting.
β entity-activation-range.wake-up-inactive.villagers-for
Decrease this in spigot.yml.
Recommended: 20.
β entity-activation-range.wake-up-inactive.flying-monsters-for
Decrease this in spigot.yml.
Recommended: 60.
β entity-activation-range.wake-up-inactive.villagers-max-per-tick
Decrease this in spigot.yml.
Recommended: 1.
β entity-activation-range.wake-up-inactive.animals-for
Decrease this in spigot.yml.
Recommended: 40.
β entity-activation-range.wake-up-inactive.monsters-max-per-tick
Decrease this in spigot.yml.
Recommended: 4.
β entity-activation-range.wake-up-inactive.flying-monsters-max-per-tick
Decrease this in spigot.yml.
Recommended: 1.
β entity-activation-range.wake-up-inactive.animals-max-per-tick
Decrease this in spigot.yml.
Recommended: 2.
β entity-activation-range.wake-up-inactive.monsters-for
Decrease this in spigot.yml.
Recommended: 60.
β arrow-despawn-rate
Decrease this in spigot.yml.
Recommended: 300.
β tick-rates.mob-spawner
Increase this in config/paper-world-defaults.yml.
Recommended: 2.
β tick-rates.container-update
Increase this in config/paper-world-defaults.yml.
Recommended: 3.
β mobs.villager.spawn-iron-golem.radius
Increase this in purpur.yml.
Recommended: 5.
Requested by thebacon.
That CPU is god awful
change asap
Do you have any command blocks?
or datapacks?
the CPU is fine it's just more active attm, but the TPS was still collapsing even when it was empty
no... it's not
this is not fine
![No description](https://cdn.answeroverflow.com/1277372997690200114/image.png)
(context: single thread is what matters for minecraft. GHz or multithread is irrelevant)
it's not the actual machine CPU it's on Pterodactyl, so dockarize and assigned several threads to run on, but I can unlock it to use all at will
yes but... minecraft is primarily singlethreaded
the cpu is an E3-1230v6
yes i know
so giving it unlimited use of the cpu does nothing
because the singlethreaded perf sucks
ah yes, for what we need it works ok, it's pretty much the same single-thread performance as the i7-7700K.
β¦.
an i7-7700k is almost 1000 more MOps/Sec singlethread
2,719 to be exact
.
.
about all on plugins
![No description](https://cdn.answeroverflow.com/1277375290016006144/SNAGHTML1fa322e.png)
terralith and so forfh, the other admin did the pack, while this problem began to sink the tps it started hitting back at entity spawn
can you provide a list of what datapacks you have
oh oups my derp sorry,
![No description](https://cdn.answeroverflow.com/1277376411912372235/SNAGHTML1fe4630.png)
jesus
try find plugin alternatives for as many of those as possible.
please run the β/perf startβ command
then chuck the zip file generated in the /debug/profiling folder into https://misode.github.io/report/ and go to the profiling section
perf is the one that's not working, it doesn't do anything idk why
/perf starts running and ends without an error, no logs no nothing
yes
it makes a zip file
in the debug folder
it's unresponsive to /perf start, if I do stop right after it says it's not running
does it make any file in the /debug/profiling folder
from the home install folder no debug, maybe because the folder is not created?
Are you running the command in console or ingame?
ig, on the console does something else
I guess better to start with this issue then, /perf not starting hmm
It should be running. Try do it ingame always and ensure you have permissions for it, and bear in mind it finishes after 10 seconds
I am researching to understand why of this, I manually created and gave perms on the .minecraft/debug folder but that didn't got it to start
can this be because of /timings?
/timings shouldnβt exist
If it is enabled disable it
what I just got from purpur said perf is disabled, is meant to use spark
oh :/
I am actually running spark right now, every hour of uptime, something kicks that gets the tick rate to recover back to 20 instantly
then after a few minutes, it goes back to 10
and below
purpur should have the option to turn /perf back on
(temporarily)
so I'm seeing if this spark capture actually captures the drop
you can use the only ticks over flag to only capture ticks that are laggy
this the last one recovered to 20 and collapsed to under 10 at the end https://spark.lucko.me/jiP7DS2b7x
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
Spark Profile Analysis
These are not magic values. Many of these settings have real consequences on your server's mechanics. See this guide for detailed information on the functionality of each setting.
β entity-activation-range.wake-up-inactive.villagers-for
Decrease this in spigot.yml.
Recommended: 20.
β entity-activation-range.wake-up-inactive.flying-monsters-for
Decrease this in spigot.yml.
Recommended: 60.
β entity-activation-range.wake-up-inactive.villagers-max-per-tick
Decrease this in spigot.yml.
Recommended: 1.
β entity-activation-range.wake-up-inactive.animals-for
Decrease this in spigot.yml.
Recommended: 40.
β entity-activation-range.wake-up-inactive.monsters-max-per-tick
Decrease this in spigot.yml.
Recommended: 4.
β entity-activation-range.wake-up-inactive.flying-monsters-max-per-tick
Decrease this in spigot.yml.
Recommended: 1.
β entity-activation-range.wake-up-inactive.animals-max-per-tick
Decrease this in spigot.yml.
Recommended: 2.
β entity-activation-range.wake-up-inactive.monsters-for
Decrease this in spigot.yml.
Recommended: 60.
β arrow-despawn-rate
Decrease this in spigot.yml.
Recommended: 300.
β tick-rates.mob-spawner
Increase this in config/paper-world-defaults.yml.
Recommended: 2.
β tick-rates.container-update
Increase this in config/paper-world-defaults.yml.
Recommended: 3.
β mobs.villager.spawn-iron-golem.radius
Increase this in purpur.yml.
Recommended: 5.
Requested by thebacon.
Do the lag spikes happen frequently? How often?
with 3 peeps on was consistently around 10 or even below, then it did that recovery per hour of uptime and went consistently to the same after few mins
when generating chunks that's heavy on it too apparently
You should pregenerate :/
yeah we did if I travel around chunks that were pregen just server loading and mob spawn will tank it but it recovers after
with several peeps on, it will be consistent, it's not a tps collapse when it loads/gens and recovers, it's just the collapse
even if 3 players are in place doing their stuff it won't sustain past 15
!binary you can try do a binary search on all your datapacks
Binary search your plugins
Remove half of your non-essential (ie not things like PAPI or LuckPerm) plugins and see if the problem is fixed.
If it still persists, the cause is in the half still installed.
Continue to halve the remaining plugins until you've narrowed it down to a single plugin.
Congratulations, you found the culprit.
![From An unknown user](https://images-ext-1.discordapp.net/external/d8SL_7PkPk222VIH3JsGH-tKWtARsGwW2zKTFjyjKHE/https/devopedia.org/images/article/28/2951.1490520804.gif)
Admincraft Canned Responses
yep will need the dev to help there I know these things have such intertwined dependencies it's not even funny
Datapacks are poorly optimised in general and you should remove as many as possible, or find plugin alternatives
Several of those packs are world gen packs or structure packs which shouldn't have to many issues. If you can get /perf working it will massively help you identify the culprit.
Do you have an idea how to get past the disable purpur did on perf? they also did the same on timings.
https://github.com/PurpurMC/Purpur/blob/ver/1.21.1/patches/server/0254-Remove-Mojang-Profiler.patch
Found the purpur patch that disables perf, removing it and compiling might do the trick, not used to how to actually successfully compile this hm
![No description](https://cdn.answeroverflow.com/1277471026040799376/image.png)
@Bacon
oof π
thats on their github page
GitHub
GitHub - PurpurMC/Purpur: Purpur is a drop-in replacement for Paper...
Purpur is a drop-in replacement for Paper servers designed for configurability, and new fun and exciting gameplay features. - PurpurMC/Purpur
yep got there until the part where it compiles and F
Got me lost there, server has java 21 installed same version as the gradlew --version
what do you even use from purpurs config
For safety reasons we do not allow executables to be sent as they might contain malware. If you're compiling for someone please DM them and as a reminder. We cannot verify if a compiled jar has not been tampered in any way
For safety reasons we do not allow executables to be sent as they might contain malware. If you're compiling for someone please DM them and as a reminder. We cannot verify if a compiled jar has not been tampered in any way
ok so no zip's hm
DM it if you wish
sorry the derp, here the perfs I took: https://mega.nz/folder/0kNCCAoK#qymwIQPfnMz_KkHvYo2TQA
They with 2 peeps on, 2024-08-26_14_34_47-world-1_21_1 with 3 peeps on.
914.7 KB folder on MEGA
5 files
look into ketket furnitures
and cavernous
(datapacks)
they're arguably the laggiest datapacks
kk thank you, relayed this to the dev I think he can get a plugin alt for cavernous, the furnitures is easy to understand it oof'ing.
any other feedback?
these are your laggiest functions
![No description](https://cdn.answeroverflow.com/1277643467249553438/image.png)
ketket and cavernous are the laggiest
I would recommend you move to ZNPCsPlus (use their latest development build) over Citizens. It's more performant
They have a migrator too
Do you use any of the additional purpur customisation options?
no, don't believe so
then you'd be better off using https://pufferfish.host/downloads
Pufferfish Host | Downloads - Pufferfish Fork
Download Pufferfish and Pufferfish+ Minecraft server jars
you'd only use purpur if you need its customisation options
otherwise use puffer
ah yes he wanted customization but we ran into the tps oof before got to that point
how did you parse the perf data like that btw?
misodes report website
misode.github.io/report/
thank you!
By the way, we removed furniture that was the largest culprit, but we dealing with cavernous now. It makes no sense to using that much tick rate when terralith/terratonic are fine.
Especially when playing on nether for example. We're using this https://modrinth.com/datapack/cavernous-x-patched
What would be the next steps, removing cavernous will not let the world boot but it's not necessary as we already know it's the culprit.
I would recommend getting with your dev to see if they can go through the datapack and optimize the datapack and possibly just remove the command based systems and make them into a plugin.
investigation time jesus this is quite the challenge
ye
Also on the last spark profile, what is this?
![No description](https://cdn.answeroverflow.com/1277698970675843205/image.png)
that is almost guarenteed a datapack. thats when a command uses something like
@a
or @e
as it then has to catalogue and reference every entity.
typical recommendations for datapack devs is to use those as little as possible(if trying to be efficient) and if possible have one or none of those.the .test on the end made me sus
Its the game testing entities to see what ones match specified parameters of a search
iirc