[0.14.0][MP] Terribly slow saving of game

Bugs that are actually features.
Post Reply
yfcz
Inserter
Inserter
Posts: 47
Joined: Mon Jul 04, 2016 7:27 pm
Contact:

[0.14.0][MP] Terribly slow saving of game

Post by yfcz »

Hello,
I'm not sure if I should to write this as bug report or feature request as it could be placed in both categories.

I have server with quite low main memory, here specs of the server:
CPU: 1 core of Intel Xeon CPU E5-2650 v3 @ 2.30GHz
Main memory: 1 GB
HDD: fast modern SSD

Factorio's server runs pretty smooth on such server except one situation — saving game. Saving game takes over one minute which is terribly long.
The problem is you cannot play until saving is finished.

It seems that some memory-intense work is done using swap space instead of main memory. During saving I see that ~130 MB is constantly read and 20 MB is constantly saved to swap.
Swap space is used most probably due to full main memory.

-----------------

So the question is there any viable way to optimize saving?
Add possibility for incremental saves?
Add possibility to disable auto-saves when players connects?

Loewchen
Global Moderator
Global Moderator
Posts: 8389
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.14.0][MP] Terribly slow saving of game

Post by Loewchen »

Considering the little amount of memory of the server, this is not unexpected behaviour. It might improve slightly with new save file size reducing methods in the future but in general you should consider switching to a more capable machine.
NaB.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.14.0][MP] Terribly slow saving of game

Post by orzelek »

You can try using undecorator mod. It helped someone with memory usage on headless server so might alleviate the problem for some time until save increases again.

yfcz
Inserter
Inserter
Posts: 47
Joined: Mon Jul 04, 2016 7:27 pm
Contact:

Re: [0.14.0][MP] Terribly slow saving of game

Post by yfcz »

Loewchen wrote:Considering the little amount of memory of the server, this is not unexpected behaviour. It might improve slightly with new save file size reducing methods in the future but in general you should consider switching to a more capable machine.
NaB.
If you don't consider it as bug, move it to „Ideas and Suggetions“ instead to „Not a bug“, please.

--------

In my case buying more memory is not an option for me since I rent that server as service for 1 € per month.
Server with 2 GB of main memory costs 5x more. That high price is no-go for me.

And it's not just me. Imagine if price 1 € per month would be fully sufficient to run Factorio server. It would allow much wider audience to run servers if one can keep operating costs radically low.

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

Re: [0.14.0][MP] Terribly slow saving of game

Post by Rseding91 »

Factorios minimum system requirements is 2 GB of RAM and even then that's the minimum. If your save file grows you will need more.

There's no bug here.
If you want to get ahold of me I'm almost always on Discord.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: [0.14.0][MP] Terribly slow saving of game

Post by DaveMcW »

Purchase Page wrote:System requirements for running the game are: 1GB RAM, 512MB dedicated video memory.

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

Re: [0.14.0][MP] Terribly slow saving of game

Post by Rseding91 »

DaveMcW wrote:
Purchase Page wrote:System requirements for running the game are: 1GB RAM, 512MB dedicated video memory.
Well that's wrong... It needs to be updated to match what steam says.
If you want to get ahold of me I'm almost always on Discord.

yfcz
Inserter
Inserter
Posts: 47
Joined: Mon Jul 04, 2016 7:27 pm
Contact:

[0.14.1] Save-game progress bar doesn't show progress

Post by yfcz »

Hello,

currently it takes around six minutes to save game on my server.
During first two minutes it is showing empty (0 %) progress bar. Last two minutes it is showing full progress bar (100 %). Using resource monitor I verified that game is doing some memory-intense stuff during these times.

It confuses connecting players and makes them think that server is not working properly.
Last edited by yfcz on Sat Aug 27, 2016 9:34 pm, edited 1 time in total.

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.14.0][MP] Terribly slow saving of game

Post by posila »

Can you provide your save so we can investigate its memory usage?

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

Re: [0.14.1] Save-game progress bar doesn't show progress

Post by Rseding91 »

six minutes is insane.. can you upload the save file?

The longest I've ever seen a save file take to save is 4 seconds.
If you want to get ahold of me I'm almost always on Discord.

yfcz
Inserter
Inserter
Posts: 47
Joined: Mon Jul 04, 2016 7:27 pm
Contact:

Re: [0.14.0][MP] Terribly slow saving of game

Post by yfcz »

posila wrote:Can you provide your save so we can investigate its memory usage?
With save attached to this post it takes around 6 minutes to save game.

iotop shows something like 100 MB average read and 30 MB average write by Factorio process from/to swap space during saving.
If I do approximate calculation it goes like this:
6 m * 60 s * 100 MB = 36 000 MB read from swap
6 m * 60 s * 30 MB = 10 800 MB written to swap

That's a lot of data. :shock:

---------------

I found workaround.
1) I processed map by orzelek's UnDecorator mod (removed details on the map)
2) I removed all items lying on the ground (huge number of alien artifacts).

These two things together (one is not enough) temporary decreased save time from six minutes to ten seconds. One day passed and saving takes like two or three minutes again (big par of map has been discovered by players).
Attachments
_autosave21.zip
(53.82 MiB) Downloaded 95 times

Loewchen
Global Moderator
Global Moderator
Posts: 8389
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.14.0][MP] Terribly slow saving of game

Post by Loewchen »

Merged and reopened.

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

Re: [0.14.0][MP] Terribly slow saving of game

Post by Rseding91 »

How much memory are you giving to the process? It sounds like it ran out of RAM a long time ago and is constantly swapping to the disk.

It takes 5 seconds to save the game when I test it on my computer.
If you want to get ahold of me I'm almost always on Discord.

yfcz
Inserter
Inserter
Posts: 47
Joined: Mon Jul 04, 2016 7:27 pm
Contact:

Re: [0.14.0][MP] Terribly slow saving of game

Post by yfcz »

Loewchen wrote:Merged and reopened.
I believe these two merged topics are unrelated.

One is about poor performance. The other is about progress bar.

It might look that there might be same cause of these two problems, but I doesn't looks like to me. I believe that performance issue described at „progress bar topic“ just helped to make wrong behavior of progress bar much more obvious (but it is not its cause).

Why? Even if loading is pretty fast (ten seconds) I see that at the beginning and the end of saving there are periods when progress bar is not updated. These periods are just much shorter and therefore harder to spot.

yfcz
Inserter
Inserter
Posts: 47
Joined: Mon Jul 04, 2016 7:27 pm
Contact:

Re: [0.14.0][MP] Terribly slow saving of game

Post by yfcz »

Rseding91 wrote:How much memory are you giving to the process? It sounds like it ran out of RAM a long time ago and is constantly swapping to the disk.
There is 1 GB of physical memory available and 4 GB of swap space available.

When game is running and NOT saving it consumes around 700 MB (70 %) of physical memory and 1,7 GB (less than 50 %) of swap space.
Memory usage is the same when game IS saving.

Also when game is NOT saving I just see little bursts of data (few kB up to few MB per few secods) are read/written from/to swap space. When game is NOT saving amount of IO operations related to swap space tend to be very low.
Rseding91 wrote:It takes 5 seconds to save the game when I test it on my computer.
Same on my desktop.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5152
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.14.0][MP] Terribly slow saving of game

Post by Klonan »

yfcz wrote:
Rseding91 wrote:How much memory are you giving to the process? It sounds like it ran out of RAM a long time ago and is constantly swapping to the disk.
There is 1 GB of physical memory available and 4 GB of swap space available.

When game is running and NOT saving it consumes around 700 MB (70 %) of physical memory and 1,7 GB (less than 50 %) of swap space.
Memory usage is the same when game IS saving.

Also when game is NOT saving I just see little bursts of data (few kB up to few MB per few secods) are read/written from/to swap space. When game is NOT saving amount of IO operations related to swap space tend to be very low.
Rseding91 wrote:It takes 5 seconds to save the game when I test it on my computer.
Same on my desktop.
Minimum requirements are 2GB of ram,

If you can reproduce the issue on a machine which meets the minimum specs please make another bug report

Post Reply

Return to “Not a bug”