MekaSuit Lag
SallyMcSaggy opened this issue ยท 20 comments
Issue description
When 2-3 or more players have a fully upgraded MekaSuit set while wearing it, the server TPS drops drastically. It seems like some of the modules are causing it, from the testing I've been doing while enabling them one by one. When all of the modules are disabled, everything is fine.
Steps to reproduce
- Put on all of the MekaSuit armor pieces.
- Enable all, or some of the modules.
- Server TPS go brrrrrrrrr.
Minecraft version
1.18.x or earlier (No longer being developed)
Forge version
40.1.80
Mekanism version
Older
Other relevant versions
No response
If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)
No response
Could you please provide some profiling using spark or something?
Looks like the main source of lag is due to having a ton of advancements that trigger based on changes to your inventory that then are being checked a ton. Doesn't seem to be related to mekanism at all (unless maybe ever so slightly indirectly due to say the charge distribution unit causing the NBT of items to change as it charges them)
Looks like the main source of lag is due to having a ton of advancements that trigger based on changes to your inventory that then are being checked a ton. Doesn't seem to be related to mekanism at all (unless maybe ever so slightly indirectly due to say the charge distribution unit causing the NBT of items to change as it charges them)
Staff member of the affected multiplayer server here, I'll investigate this when I have some time to throw at it. Server's running All The Mods 7 v0.4.32 if anyone wants to get to it before I do. Server's a little sensitive to this kind of thing since it's on somewhat old hardware but I feel like this should be noticeable on stronger systems too.
Update: I don't seem to notice any advancements outright yet, but I think I can comfortably say that this is only a MekaSuit issue by proxy. The server hardware definitely wasn't up to the task, but I will leave it to be known that on an E5 2680 v2, the server TPS changed from 8.85 to ~19.5 on a mid-to-end game world by having three players on the server remove their MekaSuits with these CDUs and putting them in storage where they don't tick. It's possible they might need some additional optimization in how they go about being charged, but I'm going to jump down the rabbit hole of advancements in this monster pack to figure it out, and if possible, I'll raise an issue with the ATM team.
This issue has been mitigated by a hardware upgrade but not completely resolved. It's still a 25 -> 35 MSPT change on a Ryzen 7 3800X for just two of these players to re-equip their MekaSuits on the same world. Could still be a Mekanism advancement, so I'm not closing this issue just yet.
Can confirm a similar issue, uncertain the cause since if I clone the armor and all the configs from someone, I dont have the error. Its something player specific, tied to the meka armor, but not about the physical armor itself.
Edit: Im also on 1.19.2 on ATM8, so this isnt on old mc.
Potentially new info regarding it? This issue may be linked to ftb quests I think. So far its been basically impossible for me to link it to anything, baring completely copying a players data to me and becoming them. Plus in spark reports, meka suites themself never show up high on the lists. However, I noticed this time that FTB Quests was higher in the spark profiler list than normal, and we havent had the meka suite issue too much till now where a player was over 20000 micro tics.
Still ATM8, on version 1.0.17, the latest as of writing. This is their FTB Quests section for mekanism for the player online with the worst individual player tick lag:
Here is Observable pointing out players are lagging (only 9 players on at the time):
Overall spark fire tree, showing mekanism isnt really high up there, but something is taking up a bunch of a servers player tick calculation:
Close up spark fire tree for the player tick:
This should line up with the players as observable is reporting the overall player ticks at around 32308 u/t:
And the tics for the server player tick being 26,844 ms. I know they are not the same ect, but these measurements are also not taken directly during the same time frame, and were slightly different durations:
This guess could be wrong, but I have been wondering what causes ftb quests to show up high on the list inconsistently, and i think its just about as inconsistent as meka suites being laggy.
Ill have to test this myself, as I know in the past I tried to replicate it by copying a players meka suite and I could not reproduce it. I will update here if I can replicate it.
I haven't really checked the FTB Quests section, but I noticed that the players with the Vision Enhancement Unit caused lag. Both players with the Vision Enhancement Unit had a considerable amount of u/t, one with 9900 and one with 28000 (both on the same team, having the same quests).
With the Vision Enhancement Unit/s:
Without the Vision Enhancement Unit/s: Lost the screenshot for the other player
I tried two things. First thing I did was copy the meka suite armor from someone who was end game, and sat there tweaking the settings of the module and removing then reading it. This had no affect on my player entity lag.
I then cleared my inventory, spawned in a fresh meka helm, and threw in 4 vision module upgrades and enabled them. This still had no affect.
Are you able to confirm that their impact on the server is reduced when they remove the upgrade?
I haven't really checked the FTB Quests section, but I noticed that the players with the Vision Enhancement Unit caused lag. Both players with the Vision Enhancement Unit had a considerable amount of u/t, one with 9900 and one with 28000 (both on the same team, having the same quests).
With the Vision Enhancement Unit/s:
Without the Vision Enhancement Unit/s:
Lost the screenshot for the other player
Apologies: This pack was actually retired from my server, although I can pull it out of the mothballs for a test. Life's been busy too.
I had issues with replication and was simply able to narrow it down to the suits, not any specific module. This is very interesting to see and I've noted the compound problem. Probably time to take this to FTB, I think. This issue can be slept pending investigation on third parties.
Not really enough info to go one here, aggregates don't help isolate anything.
Indeed seems to be related to ftb quests checking things
I can confirm this happened to me too, it happened only after I did a manual inventory rollback . It was on atm8 1.1.0. . I've got plenty of spark and obsrevable profiles to go around if it can be useful. I also found out the lag is there but reduced when you activate it without chestplate. https://www.reddit.com/r/admincraft/comments/18s7mdi/inventory_rollback_caused_some_lag/ wrote a reddit post about it here
Your profiles show its also due to advancements, just like was commented on your reddit thread
Well I know, this is what I thought at first as well but evidently it's not. I'm no developer so I don't know why this happens but I troubleshot it thoroughly and lose about half my tps when activating the vision enhancement unit, so clearly something is going on.
It uses power, which updates the saved data, which then triggers checking all the item based advancements
So i had this issue on my server running ATM9 1.20.1 0.2.34
I was sent this, and did some learning, though idk about ftb quest, since we don't have mecha suit as a quest in atm9, but advancement mabey, but don't see it. But I do know when you are wearing the mecha suit and you are charging it/using it. It does start causing massive tps issues, idk if that is helpful for anyone.
I'm having this issue too. The charge distribution unit also causes lots of lag. If anyone has a fix please tell. For now I've just been telling players to not use those modules.