Applied Energistics 2

Applied Energistics 2

137M Downloads

Item Exporter causes lag

MCaesar opened this issue ยท 9 comments

commented

Describe the bug

Noticed especially when exporting a large quantity of items. First noticed when exporting roughly 20-30k end stone into a quantum storage unit from Tech Reborn. It seems the exporter start out slow, then ramps up its speed over time (confirmed in AE2 discord as better for server performance). If there's a cap on the speed, the cap is too high, otherwise it's ramping up to a speed the game can't handle. As soon as the exporter is disconnected the lag immediately stops.
The lag seemed to be worse with 4 accelerator cards, presumably because it reaches untenable speeds faster, but still noticed the lag on an exporter without any cards, although not as extreme.

How to reproduce the bug

Allow an item exporter to run continuously, the longer it runs the worse the lag gets.

Expected behavior

No lag to be caused by the exporting of items, regardless of how long it runs.

Additional details

Tech reborn quantum storage was a good way to notice the problem, as it allowed for a long period of continuous transfer. Disconnected exporter because of the lag, didn't let it get to the point of crashing, so unsure if it would get that extreme.

Which minecraft version are you using?

1.17

On which mod loaders does it happen?

Fabric

Crash log

https://pastebin.com/hayD2dTk

commented

To summarize: We think this is not actual lag. It's the ME terminal being broken by your network inventory rebuilding each tick (due to another bug). The symptom in this case would be: you try to pick up an item from the network and nothing happens.

We'll fix item pickup being broken in the next release, while fixing the inventory being rebuilt each tick later.

commented

I can't reproduce this with just TechReborn and AE2, and this setup (full aceleration cards):

grafik

It doesn't drop below 1ms/tick and remains at full FPS. Profiling results are also not very interesting. Can you run a profiler (i.e. spark) to see where this is coming from?

commented

Install https://www.curseforge.com/minecraft/mc-mods/spark, run /spark profiler and post the profile (while the lag is happening).

commented

Apologies for the delay. I should have clarified that the lag is system lag, not FPS lag. I'm unable to place items in or take items out of the network, or request any crafting. The whole AE2 network basically freezes until the exporter is disconnected. Running a spark profiler on it, currently have it exporting a large amount of mossy stone into a recycler for scrap.
https://spark.lucko.me/TjomUTnymF

commented

Hmmm, this looks like a client profile. I'd need a server profile if possible (needs spark on the server).

commented

Ah ok. Playing on AQM2's official server, will ask for a profile.

commented

Stopped the profiler while exporter was still connected/exporting. After stopping it, disconnected the exporter, system lag was immediately gone.
https://spark.lucko.me/51ZQ48a523

commented

Uhm, I am still not convinced this is AE2, to be honest. Looking at the profiler you linked, look at the tiny amount of tick-time that AE2 is actually using:

image

Compare that with the time spent on ticking entities:

image

Are you certain this is not just TR spamming you to death with network packets? Can you check your task manager's performance tab and see if the network traffic spikes while the exporter is active?

commented

I watched the network traffic, no change before/after disconnecting.
It looks like it's not just limited to the exporter... my system has had importers running almost nonstop for awhile now, no problem. The exporters seemed to be the exclusive cause, however after they started causing problems, I tried using storage busses as an alternative. I now have a storage bus placed on a barrel with a high priority to act as a makeshift exporter, and I'm seeing the same issue. The longer it is connected, the more my system freezes. At first it takes multiple clicks to grab items or activate a craft, eventually nothing can be accessed. I cut a cable to disconnect the bus, and the system works fine again. Then when I reconnect it slowly builds up the lag again.