CodeCrafter47 / BungeeTabListPlus

GNU General Public License v3.0
148 stars 70 forks source link

Tab list ping spikes whenever someone joins, gets sorted, or have their tab status changed. #220

Open mibby opened 7 years ago

mibby commented 7 years ago

I noticed the BungeeTabList ping display spikes from a stable number up to a high count (300+) for a second whenever someone joins the server, gets sorted, or have their name changed such as if going afk or no longer afk.

Is there any way to prevent the ping from spiking or is it all tied to the same update thread?

CodeCrafter47 commented 7 years ago

The ping is not determined by BungeeTabListPlus itself, but by the (spigot) server. BungeeTabListPlus only displays the ping.

mibby commented 7 years ago

So then the ping spiking on the display would be the server thread itself being blocked by other plugins / permission calls when players login / need re-sorting?

CodeCrafter47 commented 7 years ago

The ping packets are handled on the players event loop (netty), not on the games main thread, so they ping is not affected if a plugin blocks the main thread for an extended period of time. However it is affected by async events being delayed, and also by high CPU loads in general.

mibby commented 7 years ago

Hmm. So could routine java garbage collections be causing the spikes? I'm not sure what async events would be delayed consistently.

According to my node, the machine CPU usage never goes above 10% at the maximum.

CodeCrafter47 commented 7 years ago

Garbage collections pause the entire application for a short period of time so they can be the cause of this effect.

mibby commented 7 years ago

I use an optimized set of garbage collection start-up arguments by @Aikar on java 8, so if that truly is the cause of the random ping spikes, that's a bit disheartening. :(

"{JAVA}" -server -Xmx10240M -Xms10240M -Dfile.encoding=UTF-8 -XX:MaxGCPauseMillis=100 -XX:+UseG1GC -DIReallyKnowWhatIAmDoingISwear=1 -XX:TargetSurvivorRatio=90 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AggressiveOpts -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -Djline.terminal=jline.UnsupportedTerminal -jar "{JAR}"

Generally in-game TPS is stable around 20 with hardly any drops below 19.9x.

CodeCrafter47 commented 7 years ago

I'm not saying it is the cause, I just said that GC can cause this effect. Also keep in mind that the ping packet and its processing can be delayed anywhere along the road.

mibby commented 7 years ago

Is the ping packet tied to all users, not individual packets for each user? As when the tab list display changes due to a player login or afk status change, the ping display seems to spike for everyone for that second.

CodeCrafter47 commented 7 years ago

Ping packets are sent out to players periodically by the spigot servers. A ping packet is always tied to a specific connection.