Max size Induction Matrix (18x18x18) Causes Server Lag
Nonsanity opened this issue · 10 comments
This isn't the first Mekanism multiblock to cause server lag. We've previously taken down all the salination towers for a similar reason, but the extent that the Induction Matrix causes lag is far, far greater.
TPS: 14.1 Single Entity | Time/Tick | % TileEntityInductionPort {2792,59,5431}:0 | 2.036 | 4.927 TileCustomCable {2793,76,5446}:0 | 1.010 | 2.445 TileCustomCable {2793,76,5433}:0 | 0.996 | 2.411 TileEntityInductionPort {2808,59,5432}:0 | 0.976 | 2.361 TileEntityInductionPort {2807,74,5448}:0 | 0.975 | 2.359 Chunk | Time/Tick | % 0: 174, 339 | 6.168 | 15.034 0: 174, 340 | 5.074 | 12.367 0: 175, 339 | 4.070 | 9.920 0: 175, 340 | 4.044 | 9.856 0: 0, 9 | 0.805 | 1.961 All Entities of Type | Time/Tick | % TileEntityInductionPort | 16.361 | 39.878 TileCustomCable | 2.092 | 5.098 TileConduitBundle | 1.654 | 4.032 TileMultipartContainer$Ticking | 1.321 | 3.220 monster.EntityWitch | 1.001 | 2.439 Average Entity of Type | Time/tick | Calls TileEntityInductionPort | 0.824 | 2800 TileEntityWeatherStation | 0.116 | 88 tile.TileController | 0.088 | 987 EntityButterfly | 0.070 | 141 TileExternalStorage | 0.067 | 705
The difference between having that thing loaded or not is night and day. Since the lag seems to be concentrated at the induction ports, look to the code that adds energy and see what an 18x18x18 matrix filled with Ultimate cells does. I think you'll find a serious inefficiency there.
This is with the latest—as of today—version. The Avant 3 pack got it's 1.16 update JUST to make sure this hadn't been fixed.
Confirm, just built an 18x18x18 induction matrix with ultimate cells and it put an extra 10ms on my server response time as compared to without.
i am on 1.12.2 and this is still an issue
https://pastebin.com/qe8iHMgE
my server crashed due to the amount of them out there creating an big lag
i had tried using 1.12.1-9.4.1.326 and i had compile this
https://github.com/aidancbrady/Mekanism/tree/1.12
cause it seem to have more fixes but both didn't seem to fix this problem
not sure if this help but here is my timings report
https://timings.aikar.co/?id=ff611d8b00aa478d9cdb1dfdde25d126
that prove that this is what is causing the lag
@JoeSGT Your first crash is crashing in Minecraft/sponge code, not something we can fix.
Does that timings report include a way to see what actual function is taking a while? it only seems to show that 'oh this block is taking a while' - if it doesn't there's not much that can be done.
Induction Matrices are nowhere near optimized- right now all energy cells in the matrix are referenced and updated whenever a new energy value is set. Definitely on the agenda to fix this.
Don't cross chunk border with multiblock structure. Regardless of the documented max size Sent via the Samsung Galaxy S® 6, an AT&T 4G LTE smartphone
…
-------- Original message -------- From: DumbSlayer [email protected] Date: 12/21/17 10:27 PM (GMT-06:00) To: aidancbrady/Mekanism [email protected] Cc: Bebo [email protected], Comment [email protected] Subject: Re: [aidancbrady/Mekanism] Max size Induction Matrix (18x18x18) Causes Server Lag (#3956) ive use this on like 3 servers and ive lag the shiz out of em xD — You are receiving this because you commented. Reply to this email directly, view it on GitHub<#3956 (comment)>, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEN1l1jEUm4jKb3m37vW42Q_2V-8fzBAks5tCy-ygaJpZM4Kr8Ax.
Since 18x18 is slightly larger than a chunk size, border crossings are unavoidable.
uhh, you know you dont have to make a full sized one? So yeah, it is avoidable.
But if you do, just make sure it's properly chunkloaded, by a decent chunkloader
Don't cross chunk border with multiblock structure. Regardless of the documented max size Sent via the Samsung Galaxy S® 6, an AT&T 4G LTE smartphone
…
-------- Original message -------- From: DumbSlayer [email protected] Date: 12/21/17 10:27 PM (GMT-06:00) To: aidancbrady/Mekanism [email protected] Cc: Bebo [email protected], Comment [email protected] Subject: Re: [aidancbrady/Mekanism] Max size Induction Matrix (18x18x18) Causes Server Lag (#3956) ive use this on like 3 servers and ive lag the shiz out of em xD — You are receiving this because you commented. Reply to this email directly, view it on GitHub<#3956 (comment)>, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEN1l1jEUm4jKb3m37vW42Q_2V-8fzBAks5tCy-ygaJpZM4Kr8Ax.Since 18x18 is slightly larger than a chunk size, border crossings are unavoidable.
Just because you CAN build it that size doesnt mean you SHOULD.