Mekanism

Mekanism

111M Downloads

MekaSuit Lag

SallyMcSaggy opened this issue ยท 20 comments

commented

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

  1. Put on all of the MekaSuit armor pieces.
  2. Enable all, or some of the modules.
  3. 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

commented

Could you please provide some profiling using spark or something?

commented

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)

commented

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.

commented

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.

commented

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.

commented

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:
image

Here is Observable pointing out players are lagging (only 9 players on at the time):
image

Overall spark fire tree, showing mekanism isnt really high up there, but something is taking up a bunch of a servers player tick calculation:
image

Close up spark fire tree for the player tick:
image

This should line up with the players as observable is reporting the overall player ticks at around 32308 u/t:
image

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:
image

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.

commented

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.

commented

Update on this, I noticed the aggregated results for players was at around 9k us/t, so I requested players to disable the upgrade and remove them, just to see. This was the results.

Before:
image

After:
image

Strange that this does cause it, but I cant replicate it on my person....

commented

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: image image

Without the Vision Enhancement Unit/s: image 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?

commented

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:
image
image

Without the Vision Enhancement Unit/s:
image
Lost the screenshot for the other player

commented

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.

commented

Not really enough info to go one here, aggregates don't help isolate anything.

Indeed seems to be related to ftb quests checking things

commented

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

commented

Your profiles show its also due to advancements, just like was commented on your reddit thread

commented

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.

commented

It uses power, which updates the saved data, which then triggers checking all the item based advancements

commented

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.

commented

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.

commented

Remove all item based advancements and quests if present. That's the only way.