DiscordSRV

DiscordSRV

86.8k Downloads

Alerts causing TPS drops when chunks are being generated/loaded

JasonHorkles opened this issue · 11 comments

commented

I've not tested if this happens with other types of alerts, but when using the Matrix alerts and chunks are generated, the TPS starts to drop like crazy. This does not happen when the alert is disabled.
Here's the debug log
Here's a video of it happening

commented

https://spark.lucko.me/#eFQg18psD6
Also worth noting I have the matrix bypass perm, so not sure if it still counts violations or not with that
Here's a timings report for good measure: https://timings.aikar.co/?id=99de481b4f9247219cbecd0bfaa44adb

commented

Best theory I have for this is because the server is struggling while loading chunks the anti-cheat thinks you're hacking & is sending lots of low violation events through.
Since the last sampler result didn't provide any useful information could you try running it like this:

/spark sampler --only-ticks-over 250

... make the server tps drop by reproducing the issue ...

/spark sampler --stop
commented

Looks like it still happens, tps slowed down to roughly 10 and then I stopped
With the alert disabled and even flying at faster speeds the tps doesn't go below 19.8

commented

ok, it's definitely not what I thought before. I believe that it's caused by the ChunkLoadEvent and ChunkUnloadEvent. I've blacklisted those from alerts, please try with the latest snapshot - https://snapshot.discordsrv.com

commented

¯\_(ツ)_/¯
Bukkit's event api wasn't designed for a system like alerts. There's probably some event that is being spammed into the event bus, even though our listener is extremely minimal, sending events to the event bus at all has overhead which ultimately causes lag. And as I see it, continuing to blacklist a bunch of events is a wasted effort - I don't see how this would be fixed some reasonable way

commented

Alright, I'll just go ahead and delete my alert channels
Thanks anyways

commented

Thought about this again, came up with a possible solution; which unregisters alerts from HandlerLists when doing so is possbile. If you're still keen on trying it, the change has been pushed to development builds - https://snapshot.discordsrv.com

commented

I tried using that snapshot and the problem continues :(

commented

It seems to have fixed it for me honestly

commented

@SoyDary what alerts are you using and are you able to provide a timings report or preferable a spark sampling result

commented

I wanted to make the /ban command register in discord but it was generating a lot of lag, so then I tried to use the default alerts (/ me) or even remove everything from the embed message (images, color, etc) but it seems that just by having it working the alerts drastically lowered the tps and no type of error or warning is registered in the console.