Animated-TabList

Animated-TabList

65.2k Downloads

Ping and lags due to tablist

Sollembum78 opened this issue · 7 comments

commented

Type of bug

Performance loss or memory leak

TabList version

TabList version 5.5.6

Software version

git-Paper-780 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)

Relevant plugins

AmsActivityTracker, AmsAuctions, AmsEnchants, AmsMoney, AmsPatcher, ArmorStandTools, BannerMaker, Brewery, ChestCommands, ChunkGuard, Citizens, ConsoleSpamFix, DbLibs*, DeluxeMenus, EnchantableBlocks, EntityNBT, EpicArmor, Ersatz*, Essentials, EssentialsAntiBuild, EssentialsProtect, EssentialsSpawn, FarmLimiter, FurnitureLib, FurnitureMaker, HideArmorEnchant*, HideStream*, HikariLib, HolographicDisplays, HolographicExtension, HorseBattles*, InvisiblePacket*, KaminoApi, KitsAms, LibsDisguises, Matrix, Multiverse-Core, MythicMobs, NBTAPI, NoobProtector, NoSpawnerChange, Orebfuscator, PermissionsEx*, PlaceholderAPI, ProtectionLib, ProtocolLib, ServerSigns, skDragon, Skellett, SkinsRestorer, SkQuery, Skript, skript-reflect*, SkriptPlaceholders, spark, SpawnMarker, SQLibrary*, SuperBans, TabList, ThatPacketAddon*, TitleManager, Vault, vkbotAPI, VoidGenerator, WorldBorder, WorldEdit, WorldGuard, Yum*, ZHorse

Console error (if applicable)

No response

TabList configuration files

https://paste.gg/p/anonymous/8765016e84004ec4baf9cf21892a9097

Bug description

Recently I've updated my server to 1.16.5 and since using ProtocotolTags was no longer an option, I tried to use your TabList plugin. Configuration is very simple and everything works fine - or so I thought.

I got a lot of complaints from some (not all) players due to lags and high ping, unresponsiveness of my server. I tried to examine this situation, selected group of 5-6 testers who experienced lags.

I restarted copy of my server, deleting one plugin at a time. When I deleted your plugin they said everything was fixed. I did this test several times over and eventually deleted tablist plugin - since then I had no complaints about lags and player were happy, aside from not having fancy prefixes in tab.

I tried to dig into this and started to monitor packets. Apparently plugin sends 2 packets per player online every 3 seconds. Team remove + team add, with specific properties such as prefix suffix and some others.. So..

When we have 2 players online, each player will receive 4 packets at a time, every 3 seconds. With online of 15 players, you will receive 30 packets at a single moment. And with online of 50, you will receive 100 packets at a time - which may be considered packet spam and may affect performance of players with specific gpu's.

I had similar experience with BungeeTablistPlus which also had scoreboard packet spam. Everything looked very fancy, and I, playing on intel video chip had no problems, but players with nvidia cards complained all the time. How is it possible, why such effect - have no idea. But reducing amount of packets sent fixes this problem, that I'm sure of.

изображение

commented

It may be inappropriate for some scenarios of usage, but I suggest you add some kind of cache of info that is sent, so next packet will only be sent if info is changed.

In my case, I display ranks and clans in prefix and suffix accordingly. Ranks and clan tags do not change every few seconds, only select players have their tags changed, and if so - rarely, so this would require only a few packets about specific players, and not full online list retagged. This would drastically decrease packet spam.

With cache implemented, each player will receive packets of entire playerlist on join, and then some packets about clan-tag changes only so ofter. And maybe a repeating task every 120 seconds, in case any other plugin overrides it.

Also, for this case of use, it will be possible to create pairs of rank and clantag, and instead of creating team per player - only create teams for unique pairs of rank and tag, and add multiple players to teams.

Also I don't really understand why adding and removing team is required, if updating prefix and suffix is also possible. And this might, once again, decrease amount of packets being sent.

Perhaps all of this is inappropriate, so sorry if it is.

commented

This is not a lag or an outage. There is no evidence of lag events with timings or spark reports. These two softwares can be used to monitor server performance usage and all other server-dependent features. From the attached screenshot, all I can see is that the TL plugin sends the create and remove packages multiple times (as you said). This is also due to the fact that the processing priorities are reworked for each user, even in 3 seconds. On the other hand, constant, almost server ticks are needed to play the animations for each player without interruption.

Each player has a team name and this team name is created as soon as the player joins, but this may change due to group priorities.

Each player is given a group or the aforementioned team with a given name. These group queries come from an installed permission provider and may change in the same way. A player can have multiple groups (parents), which can cause disruption to resources as in the present case. I see that primary group search is enabled in the configuration, which results in the plugin returning the primary group from the provider so there will be no more ongoing confusion and team registration.

In this version, the method of sending packets is not changed to 2, so it is an update, which is just a help. We can consider packet sending as spam, yes, but because of the above, it is not very possible to reduce it. The only solution, and you have to solve this for you, is to increase the refresh-interval interval in config, in case if no animation is set for any of your group. This refresh interval acts as a server tick, so 20 ticks = 1 second.

BungeeTablistPlus works in almost the same way as mine. It works the same way with packets due to "small" errors in the client. In general, such large resources have already been migrated to send packets because there is no proper API or support for older versions that requires this implementation.

I ask, what does NVIDIA (as display hardware) have to do with the current case? Isn't the CPU (processor) in high use?

commented

I must clarify that lags are client-side. Meaning, server performance is perfectly fine, but users that join my server have bad performance. For example, arrow shooting is a bit delayed, pvp hits registered delayed, block breaking animation starts like a second later from hitting a block, etc.

In our testing we had several instances of spigot server within one bungee network, which are exactly identical except for this plugin.

We had another similar problems due to our custom scoreboard plugin (that thing on the right, info table). Sending a lot of scoreboard packets may reduce fps in clients and increase perceived unresponsiveness in gameplay which is very similar to high ping.

commented

High ping is mainly caused by poor network connection.

commented

Yes, I realize that. I think, I'll need to provide more proof to you. I'll try to get my hands on windows pc with nvidia card, I'll run local build of spigot with and without plugin and measure responsiveness and fps on that and record a video. Cause it seems to me, you assume I'm some kind of noob that knows nothing about this stuff...

commented

For the extra informations please also provide spark and/or timings report.

commented

Sorry for bothering. It took longer for me to collect proof that packet spam may cause fps drops and unresponsiveness, than to code my own solution. You may consider the problem solved. But I still would recommend inspect this issue, that sending too many scoreboard packets may decrease client-side performance.