Page 1 of 1
Laggy headless, why?
Posted: Tue May 30, 2017 3:34 am
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.
Re: Laggy headless, why?
Posted: Wed May 31, 2017 3:21 am
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.
Re: Laggy headless, why?
Posted: Wed May 31, 2017 4:28 am
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?
Re: Laggy headless, why?
Posted: Wed May 31, 2017 12:16 pm
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?
Re: Laggy headless, why?
Posted: Wed May 31, 2017 2:33 pm
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
Re: Laggy headless, why?
Posted: Thu Jun 01, 2017 5:31 am
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
Re: Laggy headless, why?
Posted: Thu Jun 01, 2017 9:25 am
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.
Re: Laggy headless, why?
Posted: Fri Jun 02, 2017 1:10 am
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?
Re: Laggy headless, why?
Posted: Fri Jun 02, 2017 1:48 am
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.
Re: Laggy headless, why?
Posted: Tue Jun 06, 2017 2:28 pm
by AlienX
Have you tried running an undecorator on the map save to see if that helps at all?
Re: Laggy headless, why?
Posted: Thu Jun 08, 2017 4:21 am
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.
Re: Laggy headless, why?
Posted: Thu Jun 08, 2017 6:03 am
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.