Increasing System Performance

Post all other topics which do not belong to any other category.
Post Reply
Dasani
Inserter
Inserter
Posts: 29
Joined: Sun Sep 28, 2014 8:12 am
Contact:

Increasing System Performance

Post by Dasani »

I had decided to build a base that could launch a handful of rockets every minute.

After many calculations to setup ratios and plan out the layout, I built a very organized flawless machine for performing this task. The resource requirement is immensely massive as you might imagine, but I could handle it.

Unfortunately, my computer doesn't seem to be able to.

I have 16 GB of Ram, 3.4 GHz quad core, etc. But the game is getting so slow I can't even enjoy playing it on this particular save.

I'm wondering if there is anything I can do to sort of optimize this to reduce this horrific slowdown and make the game play faster? I'm currently running 400 double-headed trains and I can't begin to imagine how many thousands of express belts I have, all of which are constantly flowing items at maximum capacity simultaneously. Is it all the belt traffic that is slowing things down more? Is it the train pathfinding/calculations?

I'm just wondering if there is anything I can do to make it a more enjoyable speed and watch this behemoth of a base I crafted over many, many hours. Would replacing trains with belts help? Would reducing the number of belts and adding more trains help? There's gotta be something.

It technically works and is capable of producing numerous rockets per minute as far as game time, but those are really, really long minutes in real time. With the time dilation involved, i'd actually be making and launching more rockets with a factory 1/10th the size.

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Increasing System Performance

Post by Koub »

Hi,

First, you should definitely post your save or a link to your save in this topic : viewtopic.php?f=5&t=17501

There is a lot of optimization being performed by the devs at this moment, and they will come with 0.15. Don't get me wrong : your game will probably never be 60 FPS, but you should be able to see the difference.

Second, there are "things" that are known to stress the system : belts for example. If there are places where logibots would be efficient (small distances, spike demand), it should help with yout FPS/UPS problems.
Koub - Please consider English is not my native language.

Losash
Inserter
Inserter
Posts: 46
Joined: Sun May 08, 2016 5:06 am
Contact:

Re: Increasing System Performance

Post by Losash »

I didn't quite understand that clearly, but did you know about UPS, FPS, what PC parts are stressed, what to build, what not to build and ect. stuff before you started doing your base?
If you didn't. I bet your base is not close to ideal in terms of how much UPS you could get with your production, no matter how high it currently is. Game becomes a lot more complicated, when you start think about UPS, not about production ratios only.

What you can do:
1) Build better, smarter, get more experience. There is always info you don't know. Learn more areas of the game. Generally become wise about game internals and externals.
2) Buy a powerfull CPU, which you can overclock on top of that. For example, I'm having I7 6700K @ 4.71Ghz
3) Buy a 3000Mhz+ DDR4 RAM. RAM is very important for this game. You will see some tiny performance boosts even after 3600Mhz (I guess). Timings are important too.
4) Ofc motherboard which can supposrt those overcloscks.
5) SSD is just a fine final touch. Faster loading at start...
6) Other components, like videocard, almost does not matter.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Increasing System Performance

Post by daniel34 »

This mod might help you: https://mods.factorio.com/mods/AntiElite/UPS-up
This mod decreases the lag of big bases. The UPS (Updates per seconds) may increase by up to 100%. All features are optional and try their best to not change the vanilla gameplay.
quick links: log file | graphical issues | wiki

Yoyobuae
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: Increasing System Performance

Post by Yoyobuae »

I'm probably missing many important details, but would it be possible to make a mod which "connects" two separate Factorio (headless) instances in some ways?

For example, imagine one instance is just power generation. The power generation grid is connected to a special entity which just drains power in a manner controlled by the mod. In another instance there's an entity which generates an equivalent amount of power also controlled by the mod. Some form of communication (Clusterio, maybe?) is needed to synchronize them.

This way the load would be distributed over the two instances. If running on the same PC then it would be distributed over two cores at least. So with four instances the load could be distributed over four cores.

Issues:
- It's going to get old to jump between servers in order to access different "nodes" of the factory
- Need to deal with the various ways the "nodes" might need to communicate (power? belts? bots? trains? teleport chests?)
- Each instance has it's independent map, but maybe that's not a necessarily bad thing.
- How to prevent MP desync issues. For sure there will be some delays in communication, probably some kind of buffering needs to be built into the system for things to work smoothly.

Dasani
Inserter
Inserter
Posts: 29
Joined: Sun Sep 28, 2014 8:12 am
Contact:

Re: Increasing System Performance

Post by Dasani »

I've never really looked into UPS or FPS before. I've built large bases before but never had this kind of slowdown, or maybe a very subtle slow down that I couldn't perceive. But this base is truly, truly massive. There's about 70,000 electric mining drills, 1,000 oil refineries, 3,000 pump jacks, About 3,000 chemical plants, about 20,000 electric furnaces, about 8,000 assembly machine 3's, about 400 unique trains of varying lengths totaling somewhere around 4,650 locomotives+cargo wagons.

I have no clue how many belts I have, I couldn't begin to hazard a guess.

I'm not sure what exactly the bottleneck is. CPU usage never exceeds around 30%, RAM is only at about 40% as well. Not sure what exactly is the hardware problem.

I will try replacing all belts with robots. That is a solution I did not consider. I'll see if that helps. :)

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Increasing System Performance

Post by daniel34 »

Dasani wrote:I'm not sure what exactly the bottleneck is. CPU usage never exceeds around 30%, RAM is only at about 40% as well. Not sure what exactly is the hardware problem.
Factorio only uses 1 thread to update the main-loop that processes all entities, so if you are on a quad-core that is at 30% cpu you're already at the limit for 1 core, 25% of the overall cpu usage for the update thread and another 5% for stuff that Factorio can process in other threads.

0.15 will bring some general performance improvements (for belts, etc.) and a first implementation of multithreading, which should increase the overall performance.
quick links: log file | graphical issues | wiki

Losash
Inserter
Inserter
Posts: 46
Joined: Sun May 08, 2016 5:06 am
Contact:

Re: Increasing System Performance

Post by Losash »

Dasani wrote:RAM is only at about 40% as well
Just wanted to quickly note, because such an approach can lead to a misconception: Your ram volume is used by 40%, but it's much harder to mesure, how much it's really used, I mean throughput. Believe me, that was proven many times, even by Rseding, that faster RAM will almost surely mean more FPS, due to how much data is rewritten in the memory all the time.

Also seing your numbers of objects, I suspect you are not running modules or beacons? They are too large. WIth improved speed of production, you would not reach those numbers due to the lag, I think.
What are your raw outputs of coppeer and iron plates per minute of in-game tich-based time? (P button)

Mehve
Filter Inserter
Filter Inserter
Posts: 318
Joined: Sat Aug 06, 2016 9:12 pm
Contact:

Re: Increasing System Performance

Post by Mehve »

Dasani wrote:I will try replacing all belts with robots. That is a solution I did not consider. I'll see if that helps. :)
While bots are probably the most effective option, another, slightly older remedy that I believe still works is to replace lengths of belts with underground sections. Because the belt contents inside the UG sections only exist virtually, there's less calaculation required to keep everything moving smoothly.

XBBX
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Wed Jan 07, 2015 4:30 pm
Contact:

Re: Increasing System Performance

Post by XBBX »

Tips for increasing ups i did allot testing of stuff and things :
1. Replace normal belts with underground belts (line of 2 underground belts better for ups than 2 normal belts) or better bots (bots better in any distance than belts) for long distance use trains
2. This one is less common knowledge assembler speed does not matter only number of them (better have 10 assemblers with speed 10 than 100 with speed 1)
3. 1000 of solar, accu takes same amount calculations as 1 of each use solar power
4. Mods ups up can help you save some ups.
5. More moded stuff if you going full bots or allot of them by increasing bot stack size you can save allot ups ( i have mega factory save full bots and just by increasing bot stack size by +20 my ups increased from ~28 to 40-45)
6. Even more moded stuff i have not tested its just theory but if you increase inserter stack size you should get ups boost
7. Increasing assembler, train, belt speed will help launch rockets faster but it take fun away

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Increasing System Performance

Post by Rseding91 »

daniel34 wrote:... and a first implementation of multithreading, which should increase the overall performance.
Not likely. The implementation test had to be hacked in and gave minimal gains while making the code far more complex and fragile.

Factorio is not written in a way that it can be threaded without re-writing the entire thing or hacking it in - neither of which we want to do at this stage. Additionally it doesn't just give double performance when 2 threads are used.

See: https://en.wikipedia.org/wiki/Amdahl's_law
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “General discussion”