Laggy headless, why?

Anything that prevents you play the game properly. Do you have issues with paying for the game, downloading it or properly running it on your computer? Let us know here.
Post Reply
lipe123
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Sep 30, 2016 7:39 pm
Contact:

Laggy headless, why?

Post by lipe123 »

I'm running a headless server on debian 8.
Specs are 8gb ram, i7 2600k, 120Gb SSD (550/450 read write speed)
Internet is 100mbs down and 40mbs up.

1. Network lag:
I'm seeing some crazy lag when I connect from work and when i SSH into the server and look at my transfer speeds it's 50-60kB/s. not even a single MB/s going through the connection.
My pings are < 50ms from home to work and doing other random ping tests from the server to US cities etc the worst ping I can get is like 150ms.

2. Slooooooooooooow saves.
My save file is about 400Mb now and saves are painfull! With a 425Mb/s drive it should take 1, maybe 2 seconds to save but it takes like 10 seconds. When I monitor the disk use during a save factorio only goes to 20-30Mb/s writing. Why is this so slow? Isn't there some kinda cache process or something to write that save file out faster?

Just as a control when I play on LAN there is no network lag at all, I just notice it at work.

daggot
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Dec 09, 2016 6:11 pm
Contact:

Re: Laggy headless, why?

Post by daggot »

A 400 MB game file? Are you sure about that? Our large factories in our MP server only come in around 25mb.

Or, would you care to share a save? I'm curious what's taking up that much space.

lipe123
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Sep 30, 2016 7:39 pm
Contact:

Re: Laggy headless, why?

Post by lipe123 »

I calculated it roughly based on the super slow download, it was about 100mb.

My point is why is the save speed so slow, regardless of the size of the file?

daggot
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Dec 09, 2016 6:11 pm
Contact:

Re: Laggy headless, why?

Post by daggot »

Well, it's not as simple as the data is immediately ready to write out to a file. I assume it's having to do some kind of translation or compression as it writes it out. I remember reading in a FF that they were able to get save files down to almost half size. So, there's something going on in what's being written.

Still, I'm curious how your save is 400mb. Single player game? Just how big is your base?

User avatar
Distelzombie
Filter Inserter
Filter Inserter
Posts: 336
Joined: Tue May 02, 2017 4:27 pm
Contact:

Re: Laggy headless, why?

Post by Distelzombie »

Is the SSD connected right? Some Mainboard have SATA sockets that are connected to a different chipset. Like 2 sockets for SATA 6GB/s and 4 sockets for SATA 3GB/s.
Also the word "debian" does not instill much trust in me of the capabilities of the OS to detect an SSD automatically and handle it the way it should be handled.
See here for SSD Optimizations: https://wiki.debian.org/SSDOptimization
Complete 2-Lane system as a Blueprint-Book! The perfect OCD reactor? Testing chained science lab efficiency Please use real prefixes and proper rounding!

lipe123
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Sep 30, 2016 7:39 pm
Contact:

Re: Laggy headless, why?

Post by lipe123 »

As I said already I was mistaken the save file is ~100mb
Sure compression would cause some delay etc but that should be handled in a separate thread from the main game so the game can continue to run while the saving takes place.

Not sure what makes you think debian is not a capable os but lets just ignore that for now.
I did speedtests with the drive and I tested 525 read and 420 write tests with no caching cheats or whatever. Yes im sure the drive is connected to a Sata 3 port. my board has no sata 2 ones

User avatar
Distelzombie
Filter Inserter
Filter Inserter
Posts: 336
Joined: Tue May 02, 2017 4:27 pm
Contact:

Re: Laggy headless, why?

Post by Distelzombie »

Its just my experience with Linux. YOU are basically a part of the system core. Theres not as much automata than in windows.
You didnt wrote if the saves are slowly saved when you connect to LAN with it.
An idea: Do you have some sort of antivirus on that thing? It could maybe search all the traffic for viruses and----- hm now that would also contain LAN traffic. Ok I have no clue. :D
Complete 2-Lane system as a Blueprint-Book! The perfect OCD reactor? Testing chained science lab efficiency Please use real prefixes and proper rounding!

lipe123
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Sep 30, 2016 7:39 pm
Contact:

Re: Laggy headless, why?

Post by lipe123 »

The whole reason to use Linux is because of the reduced overhead.

Yes its slow on LAN as well.

No antivirus no, the machine is freshly loaded less than a month ago. There is no slowness or lag when I copy a savegame for example to another directory.

Is there anyone else with larger saves around 100mb that notice slow saves on a SSD drive?

User avatar
Distelzombie
Filter Inserter
Filter Inserter
Posts: 336
Joined: Tue May 02, 2017 4:27 pm
Contact:

Re: Laggy headless, why?

Post by Distelzombie »

lipe123 wrote:The whole reason to use Linux is because of the reduced overhead.

Yes its slow on LAN as well.

No antivirus no, the machine is freshly loaded less than a month ago. There is no slowness or lag when I copy a savegame for example to another directory.

Is there anyone else with larger saves around 100mb that notice slow saves on a SSD drive?
I guess my comprehension reaches zero at this point of progress. :)
Complete 2-Lane system as a Blueprint-Book! The perfect OCD reactor? Testing chained science lab efficiency Please use real prefixes and proper rounding!

AlienX
Fast Inserter
Fast Inserter
Posts: 103
Joined: Wed May 17, 2017 7:13 pm
Contact:

Re: Laggy headless, why?

Post by AlienX »

Have you tried running an undecorator on the map save to see if that helps at all?

lipe123
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Sep 30, 2016 7:39 pm
Contact:

Re: Laggy headless, why?

Post by lipe123 »

The scenario I'm using has he undecorator in it already.

The issue is not the save file size but the way the game handles the saves. Any file under 400mb should be written to disk in 1 second or less with a modern SSD and this is not happening.

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

Re: Laggy headless, why?

Post by Rseding91 »

lipe123 wrote:The scenario I'm using has he undecorator in it already.

The issue is not the save file size but the way the game handles the saves. Any file under 400mb should be written to disk in 1 second or less with a modern SSD and this is not happening.
Post your save file.

Also it's not as simple as "write 400 MB to disk", it's find all of the data scattered across system RAM that should be saved, determine which pieces should be saved, compress each piece and write it to disk.

Look at RAM usage: the game takes far more RAM to run than it does in the save file format because the save file is just pieces and parts of what's actually used runtime.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Technical Help”