Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max size Induction Matrix (18x18x18) Causes Server Lag #3956

Closed
Nonsanity opened this issue Nov 8, 2016 · 10 comments · Fixed by #5462
Closed

Max size Induction Matrix (18x18x18) Causes Server Lag #3956

Nonsanity opened this issue Nov 8, 2016 · 10 comments · Fixed by #5462

Comments

@Nonsanity
Copy link

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.

@deusversus
Copy link

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.

@ktole1999
Copy link

what happens if you built it 16x16x16 and all within a single chunk?

@tomelfring tomelfring added the bug label Jul 21, 2017
@aidancbrady
Copy link
Member

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.

@JoeSGT
Copy link

JoeSGT commented Nov 6, 2017

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

@thiakil
Copy link
Member

thiakil commented Nov 7, 2017

@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.

@DumbSlayer
Copy link

ive use this on like 3 servers and ive lag the shiz out of em xD

@ktole1999
Copy link

ktole1999 commented Dec 22, 2017 via email

@Takakura-Anri
Copy link

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 notifications@github.com Date: 12/21/17 10:27 PM (GMT-06:00) To: aidancbrady/Mekanism Mekanism@noreply.github.com Cc: Bebo ktole1999@hotmail.com, Comment comment@noreply.github.com 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.

@thiakil
Copy link
Member

thiakil commented Feb 15, 2019

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

@ktole1999
Copy link

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 notifications@github.com Date: 12/21/17 10:27 PM (GMT-06:00) To: aidancbrady/Mekanism Mekanism@noreply.github.com Cc: Bebo ktole1999@hotmail.com, Comment comment@noreply.github.com 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants