ReikaKalseki / Reika_Mods_Issues

The issue tracker for all of my mods - RotaryCraft, its addons, ChromatiCraft, and everything else.
46 stars 13 forks source link

Fusion Reactor causes Network Lag #3349

Open MalTeeez opened 8 months ago

MalTeeez commented 8 months ago

The fusion reactor causes (what seems like) network lag from server to client, but with client to server actions still without lag.

The server is stable at 20 TPS and receives all actions (i.e. chat messages) as normal, but the client gets everything with a delay (including the chat messages).

After some testing, by starting the fusion reactor with X number of Injectors, I noticed that the delay, waiting for one minute after turning on the reactor, starts with <1s with one injector, and +9s for each injector after that. Re-logging resets the delay, temporarily.

I have seen #2929, but I think this warrants its own issue, since that one is focused more on another issue.

MalTeeez commented 8 months ago

@EyeDeck Have you noticed this as well?

seramyu commented 8 months ago

I have experienced a similar issue to the one described above. When there is not the bug that the steam boilers simply do not accept the heat from the neutron absorbers then the reactor works. I did not notice after what version change that started to happen and i could run a four injector one very normal with a stable 20 TPS When i start one injector i notice a very minor Ping increase when i am near the reactor but everything still works reasonable without impacting gameplay. If i now continue and turn on more then one the impact gets really bad. It does not affect the TPS at all it stays constantly stable but when i am near the reactor and i open the OPIS screen i can see the Ping go up and up the more time passes. When i am around the reactor everything i try to send to the server be it a simple chat command or place blocks its delayed but all from the server is not. I can't find the screenshot but there where one or two network related things where the packets/second really exploded into very high numbers and it feels like TPS lag but its not the TPS stays stable and as soon as i teleport away the delay goes down pretty fast almost back to normal levels again. I have rebuild the whole thing it never runs out of water, coolant or charge, nothing melts or explodes. The same also happens in a new world with just the barely needed mods to build and run it.

Okay i just turned on the server. This is how it looks when i am at the fusion power plant on my server when its "idle" only coolant production and deuterium/tritium prod is running all as it used to be. javaw_FScORoxOWj javaw_geRhf11R06

This is how the fusion power plant looks after i rebuild it for don't know how many times because of bugs and other probs. javaw_XtkfR5Fxhm

This is what OPIS shows with only one Injector running. The Boilers produce no steam maybe that has somehting to do with it or not. The neutron absorbers heat up, if i remove the boilers they melt, but i get no steam. javaw_z6SJ5n03uv javaw_Cx7P5LI7EK

TPS is still fine but the ping will now very slowly increase if i leave it running like this for a few hours but the problem is contained to only the reactor place. javaw_35HJmrp8ZH

And here is what happens as soon as the second injector goes live and shoots plasma. javaw_5mQNplwFdt javaw_kvYomDWwtO javaw_Bh2uoC3RrG

Now everything i do around the reactor place has a delay that gets higher and higher very quickly until the plasma pipe runs dry again and only one keeps running.

If i then teleport away to my base.... javaw_KneruMtIGt javaw_z1lrrdHU6g

The Problem is only around the reactor place. I have tried alot of stuff before, Rebuild, relocated, unload all chunks and reboot the server, Nothing i tried fixes this.

In OPIS ist shows 1800 Neutrons but when i do a "/cofh killall neutron" there are only roughly 90 entities removed. The only other neutron source is a fission reactor at my base that runs flawlessly and does not spill any. Same goes for the Plasma count. Its roughly 360 but OPIS show 400+ javaw_Rpc3EkgLho

The Injectors can still be turned of?? I had levers under then they seem to no longer work and just popped of in one Version update. I will try a wireless high signal line instead.

EyeDeck commented 8 months ago

Yes, @redelman and I last built a fusion reactor back in November or so and observed this as well. Originally we had built the reactor near our base, but it made the area unplayable. We did some diagnostics and saw the same thing, packet spam coming from what we assumed to be neutron entities (could be fusion plasma, doubt it though). The total amount of data being transferred wasn't especially big, iirc it was like 10 Mbps or something, there were apparently just more packets than the game's network system could process and everything starts backing up.

Our "solution" was to rebuild the entire reactor far away, with a teleport between our base and the reactor, and some wireless redstone rigged to a lever that toggles the plasma injectors (strong redstone signal into the block below the actual tile entity works, in case anyone wonders). The reactor would need to be shut down any time one of us wanted to go there, unless we could tolerate relogging every 30 seconds.

MalTeeez commented 8 months ago

Opis shows outbound S14PacketEntity.S15PacketEntityRelMov, S12PacketEntityVelocity and S3FPacketCustomPayload skyrocketing (from 0/s) when the plasma entities load in.

Also I found #232, which was maybe related, but this issue is not fixed by removing extracells.