[2.1.17] Poor Performance (UPS) with Large Number of Landing Pad Unloading Bays

We are aware of them, but do not have solutions that don't cause other issues. They go here in order not to take space in the main bug thread list.
JihadJ0e
Inserter
Inserter
Posts: 20
Joined: Sat Jun 03, 2017 4:15 am
Contact:

[2.1.17] Poor Performance (UPS) with Large Number of Landing Pad Unloading Bays

Post by JihadJ0e »

Greetings,

I have a fairly large base, and overall performance is excellent. I generally sit at a solid 60 UPS. The exception is when the cargo landing pad on Nauvis receives a large shipment, at which point UPS can drop to around 15 for a second or two. As the base has grown, this has become more and more frequent.

I'm not sure if this is a bug, an optimization opportunity, or just an expected side effect of directly attaching ~700 Bio Labs to the Landing Pad.

Looking through the debug overlays, I think the cost is not in the cargo drop itself or in the landing pad's unloading, but in the inserters attached directly and indirectly to the landing pad. There are roughly 3,600 legendary bulk inserters in that chain.

My speculation is that on each drop, every directly and indirectly connected inserter re-evaluates whether it needs the item. I see the UPS drops even when no inserters actually swing, which suggests the cost is in the evaluation rather than in moving items.

Conditions that seem to matter
  • It only happens when the landing pad already holds items and a new shipment arrives. If I empty the pad first, I can deliver 840k science packs with no issue.
  • It is not noticeable when orbital platforms trickle resources down. It takes a mass drop to trigger it.
  • It only reproduces while researching a technology that consumes many different science pack types, such as Research Productivity. I cannot reproduce it while researching Mining Productivity.
  • It only occurs while the biolabs are still short on science packs. Once they are actively researching, the drop goes away.
I am not certain whether the last two are independent factors or just a side effect of how much material is being sent down in each case.

Related behavior
I have observed something similar, less severe but seemingly related, when the 40 or so stack inserters all eject spoilage at the same time. My guess is that everything spoils at roughly the same moment, so the problem is not that 40 stack inserters are removing 100k spoilage. It is that spoilage keeps reappearing and the stack inserters have to work out how to share it again and again across thousands of stacks.

Reproduction
This save has three platforms staged. No mods are installed.

Issue 1: two platforms named Spot, holding roughly 840k science packs total.
Dispatch both Spot platforms.
The first delivery arrives and the biolabs begin researching. Performance is normal here, with no drop.
A few minutes later both Spots will complete the second delivery cycle. This is where UPS collapses.

Issue 2: one platform named Trade Route, holding roughly 167k agricultural science packs that are all about to spoil.

Dispatch the Trade Route platform to reproduce the spoilage behavior described above.

A Kind Thank You
You folks are amazing, and so is this game. Thank you for creating it. Thank you for maintaining it. I am coming up on 15,000 hours. Best $30 I have ever spent.
Attachments
Shows UPS dropping to 34. It went as low as 12
Shows UPS dropping to 34. It went as low as 12
debug.png (10.29 MiB) Viewed 602 times
factorio-current.log
(11.48 KiB) Downloaded 21 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 17584
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.1.17] Poor Performance (UPS) with Large Number of Landing Pad Unloading Bays

Post by Rseding91 »

This is known behavior when making an extremely large inventory and attaching a large amount of inserters to it. As you predicted; every inserter has to do a scan over the inventory to find if any of the items are acceptable to extract - each time they wake up. They wake up each time the inventory has an item added, or the lab they face has an item removed.

That combination is just slow. You can reduce the performance impact by keeping the landing pad inventory size smaller and by reducing the number of inserters that have to interact by extracting onto belts and then feeding from the belts into the labs.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 17584
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.1.17] Poor Performance (UPS) with Large Number of Landing Pad Unloading Bays

Post by Rseding91 »

For reference; it's not *desired* that it's slow. It's just a side effect of how inserters work and how inventories work. There have been some tests internally about changing inventories but it never made it to a released state.
If you want to get ahold of me I'm almost always on Discord.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4942
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.1.17] Poor Performance (UPS) with Large Number of Landing Pad Unloading Bays

Post by boskid »

After looking at this save, it resembles 135964 as there are multiple inserters with spoil priority configured contributing most to the spike. You should be able to reduce the cost by removing spoil priority from inserters taking from cargo landing pad.
JihadJ0e
Inserter
Inserter
Posts: 20
Joined: Sat Jun 03, 2017 4:15 am
Contact:

Re: [2.1.17] Poor Performance (UPS) with Large Number of Landing Pad Unloading Bays

Post by JihadJ0e »

With Resding91's explanation I THINK I was able to completely fix this by disabling the inserters until there are at least 2k of each required science packs in the landing pad; since the inserters are already busy, they don't get bogged down evaluating every drop, a little hackey, but I'll take it!

In thinking this through, it seems like some sort of governor for the landing pad and associated unloading bays might elegantly solve this problem. Since the fundamental issue is a wave of new items arriving mere movements apart keeps re-triggering the re-evaluation of each of every chained inserter, why not rate limit the events making it to the inserter? From a game play mechanics perspective, it doesn't really matter as there already appears to be some variability in the drops arriving.

If there isn't a clean way to suppress or delay the notifications, what about internally collecting new items in to a buffer, then once a second merging that buffer into the storage, that way everything happens in a single tick.

It's probably more complicated then this.... Almost everything is ;).
JihadJ0e
Inserter
Inserter
Posts: 20
Joined: Sat Jun 03, 2017 4:15 am
Contact:

Re: [2.1.17] Poor Performance (UPS) with Large Number of Landing Pad Unloading Bays

Post by JihadJ0e »

boskid wrote: Wed Sep 09, 2026 6:15 pm After looking at this save, it resembles 135964 as there are multiple inserters with spoil priority configured contributing most to the spike. You should be able to reduce the cost by removing spoil priority from inserters taking from cargo landing pad.
Great, I'll give that a try to and report back. Thank you both.
JihadJ0e
Inserter
Inserter
Posts: 20
Joined: Sat Jun 03, 2017 4:15 am
Contact:

Re: [2.1.17] Poor Performance (UPS) with Large Number of Landing Pad Unloading Bays

Post by JihadJ0e »

As a follow-up, turning off the spoil priority appears to have fairly signifyingly improved the performance. It's not perfect, it's not amazing, but its good enough.

Disabling the inserters until there are at least 2k of each required science packs for sure improves things, but only to a point, largely because of the impact of resupplies while there is over 2k of each science pack.

I had considered some sort of super complex contraption that disables the inserters while a science pack drops are in progress, which I think would completely resolve this, however the complexity doesn't seem to be worth the benefit.

Thank you both Resding91 and boskid
Post Reply

Return to “Minor issues”