How to find a lag source + limit lag machines
I recently discovered that there is a massive lag source on my server. When someone entered its area, they immediately got 1 FPS and the whole server started lagging (TPS was going down). I realized my friends had a little fun and created a lag machine utilizing armor stands. Now, this helped me to locate the machine and destroy it, but it left me with a few questions...
1. In future situations like that, how would I locate a lag machine on my server?
2. How to protect my server from lags caused by armor stands?
3. Is there any way to prevent any lag machines that players may create?
I would appreciate any info on that. Thanks.
45 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 Biggie Cheese#8849
!spark
Spark Profiler
Spark can be used to see why your server or client is lagging.
https://spark.lucko.me/
![From An unknown user](https://media.discordapp.net/attachments/350707773706731521/1023048174010642472/unknown.png?ex=678713dc&is=6785c25c&hm=08c07ef582e882009ce683fb32323a972293d147b9629d1299ceeaebc15d0271&)
Admincraft Canned Responses
multipaper no, folia only if you have 16 cores, 32 threads
they're very much not usable for production tho
Insights plugin can be nice
How would folia help here :FrogeBIGEYES:
for question #2, i think you'll need a plugin to limit entities per chunk
yes, that may be annoying for some players but its overall better for the server's performance
something like this if not the plugin itself:
https://www.spigotmc.org/resources/entitychunklimiter.67843/
SpigotMC - High Performance Minecraft
EntityChunkLimiter
regionized multithreading, meaning it won't affect the other regions
Thanks for your suggestions, however:
1. Spark lets me identify what's causing the lag, but I don't know if it's possible to check WHERE is it located in the world (without it it's hard to eliminate I guess). This basically gave me the same results as Paper's timings.
2. Insights plugin doesn't work in 1.20.1.
3. Is there any way to limit lag machines without installing plugins? I heard that many things don't require plugins (for example simple anti-lag plugins are a bullsh*t). EntityChunkLimiter sounds okay, but it was last updated in 2021 for 1.16... I am okay with installing plugins like that, as long as they really work and have no performance impact on my server overall.
4. I set
do-collision-entity-lookups
to false
under the armor-stands
section in my paper-world-defaults.yml
file, and it seems it has helped to lower the lag a little.https://modrinth.com/plugin/insights sent u the wrong link mb
Modrinth
Insights - Minecraft Plugin
Extremely fast region scans | Find large redstone machines | Limits per chunk / region | Custom region addon api
Well, if it's entities causing lag you do have the world tab you can use to see what is approximately where.
For 3, how would you limit them without a plugin?
Not sure how you'd modify game mechanics like that "without" a plugin.
Yeah I know, I was just wondering if there are some options to limit that by things like (for example) engine configurations (like the one I mentioned in 4.)
Alright, I will check this one
Okay thanks, I found it. Now I see that there is a lot of armor stands in 1 region. My question is, how do I know which region is where? There are a lot of chunks mentioned, how do I teleport to them or something?
There is a regions section, it's numbered based on the region number. You can use a calculator to find the cords
(Calc linked above)
Okay, the calculator helped a lot!
Now one more thing... Finding a chunk that contains a lag machine is a very big step towards disabling it, but... Any tips on how to find the exact coordinates or something? The thing here is that the lag machine I had to destroy was hidden in some other building so it wasn't normally visible. Using
minecraft:kill @e[type=armor_stand,distance=..100]
solved the problem, but what if there are lots of the other armor stands that aren't a part of a lag machine, but just regular other players' items? I would want to avoid deleting them. So, what is the recommended thing to do here? Can I somehow locate the machine and use distance..10
for example, or maybe there is another way to disable the machine?You'd just have to do it the ol fashioned way
Hunt em down
Alright π
And back to my question from here ^
Is it possible to limit lag machines anyway just by a good configuration in Paper for example? Or installing some extra plugins is necessary? I don't have anything against installing plugins, it's just I already installed tons of them I don't want my server to lose the performance it currently has.
.
just having plugins doesnt reduce performance, it depends on what they do and how they do it
No, there's nothing inside paper itself that will prevent all/many/more than a few/etc lag machines.
Okay, thank you for all your help and tips. Appreciate that.
The Insights version from Modrinth works well. I'll try it and see what it can do. Do any of you recommend any other anti-lag machines, anti-exploit, or optimization plugins?
nope
most of them are snake oil
Most optimization plugins are basically snake oil
But anti-exist and anti-lag machine plugins do exist, and are "mostly" not snake oil
I'm not sure of any I'd use off the top of my head though, @goosBanny might know of some
mhm!!
clearlag can be useful on some servers. can help on very large (i'd say 100+ players) servers no matter what type, too.
CAProtect-Lite, RedstoneLimiter, AntiRedstoneClock too
entitydetection to easily find chunks with lots of entities
But don't expect clearlag to be like, end all be all. Most of its features are garbo
^
farmlimiter is great too. replaces CAProtect-Lite (capl isnt super optimized - farmlimiter can be configured to do it's job better)
too bad it's paid π
Optimization | setup.md
This section of setup.md goes in-depth for server optimization
Anti-Lag | setup.md
A brief introduction to Anti-Lag and alternative performance management tools.
and then there's Mob Farm Manager
oh yeah forgot to list that one
Alright, thanks! I will look at them.
hm you never sent a spark report
If you remind yourselves of any other you can name or link them here.
both of them are paid and exact same price :Sob_AE:
If any of them is worth the price, I might pay for it
Also, has any of you heard of an ExploitFixer? It moved some time ago from SpigotMC to BuiltByBit and is now required to pay for it, but it seems like a good anti-exploit plugin... Is it worth it? Or maybe there are better free/paid alternatives?
suggestion: 1.20.1
panilla + lpx
ExploitFixer and Panilla seems pretty good
all you need
ah forgot lpx
lpx and panilla are both paid but panilla can be compiled from its source
Ouch, LPX is much more expensive than ExploitFixer... Is it really worth the price?
What exploits are you looking to fix that paper doesnβt patch?
lpx does not do EF's job
you should just keep the server updated
EF isn't needed for latest servers
anything exploitfixer claims to patch, just send them over to paper and they'll look into it
iirc exploitfixer is opensource so it's that much easier for paper devs to fix