Page 1 of 1
Server lag after updating to 0.17.x
Posted: Mon Jan 06, 2020 11:11 pm
by rbit
Hello! I have a headless server (running on Ubuntu 18.04). Previously, it was running great when I played some months ago (on 0.16.x), but after updating it to 0.17.79, me and my friends are finding it lagging pretty bad regular (stuttering, and 'server is not responding ...' pop-ups that last for a couple seconds). What's odd is while I monitor htop processes in a terminal, it generally doesn't exceed ~30% CPU or mem usage, but it does spike occasionally to much higher. Any ideas to improve?
EDIT: I attached my log file and screenshot per
viewtopic.php?f=7&t=68653, as well as my save file. No mods installed (other than base). the .json file is simply:
Code: Select all
{
"mods":
[
{
"name": "base",
"enabled": true
}
]
}
Re: Server lag after updating to 0.17.x
Posted: Mon Jan 06, 2020 11:18 pm
by Loewchen
Re: Server lag after updating to 0.17.x
Posted: Mon Jan 06, 2020 11:26 pm
by rbit
Thanks for this. I'm still reading through what you shared, but one quick question on the FAQ (
https://www.factorio.com/faq) page for now: I notice it lists requirements for 'PC', but does not specifically mention requirements for a headless linux server (I assume less demanding). Are those visible somewhere, or should I assume they are the same CPU/RAM as the PC, just no videocard requirement ofc?
Re: Server lag after updating to 0.17.x
Posted: Mon Jan 06, 2020 11:38 pm
by rbit
I just updated the original post with required info as you pointed out. Thanks.
Re: Server lag after updating to 0.17.x
Posted: Mon Jan 06, 2020 11:51 pm
by Loewchen
I don't think there are official requirements for linux headless. Generally a headless server will outperform a client with identical hardware and it will take significantly less RAM. The server being the bottleneck is usually a non issue anyway though.
Re: Server lag after updating to 0.17.x
Posted: Tue Jan 07, 2020 12:05 am
by rbit
Loewchen wrote: Mon Jan 06, 2020 11:51 pm
I don't think there are official requirements for linux headless. Generally a headless server will outperform a client with identical hardware and it will take significantly less RAM. The server being the bottleneck is usually a non issue anyway though.
OK thanks, I suspected as much. I never had the issue in the past with several more people playing at once, so I assumed my server was more than adequate. This only seemed to begin after updating to 17.x. Hopefully someone can make some sense of this!
Re: Server lag after updating to 0.17.x
Posted: Tue Jan 07, 2020 12:16 am
by Loewchen
rbit wrote: Tue Jan 07, 2020 12:05 am
I never had the issue in the past with several more people playing at once, so I assumed my server was more than adequate. This only seemed to begin after updating to 17.x. Hopefully someone can make some sense of this!
I had not looked at your updates before, in this case I would blame the server CPU, 1Ghz base clock, 8W TDP is pretty much as bad as it gets for factorio which likes few very high frequency cores and keep in mind the server has to do all the game updates just like the clients, it can just skip the rendering.
No idea why it worked better in 0.16 I would not have expected this cpu to run any base at full speed.
Re: Server lag after updating to 0.17.x
Posted: Tue Jan 07, 2020 12:50 am
by Honktown
At the top of the debug menu (F4), there's capture-perf-stats. Might help to find which thing is specifically causing the lag. Looks to capture stats until you hit 'save', so it doesn't need to be perfectly timed. The spreadsheet is probably dumped in ~/.factorio
Was the system updated at the same time as Factorio?
Re: Server lag after updating to 0.17.x
Posted: Tue Jan 07, 2020 1:51 am
by rbit
Honktown wrote: Tue Jan 07, 2020 12:50 am
At the top of the debug menu (F4), there's capture-perf-stats. Might help to find which thing is specifically causing the lag. Looks to capture stats until you hit 'save', so it doesn't need to be perfectly timed. The spreadsheet is probably dumped in ~/.factorio
Was the system updated at the same time as Factorio?
Thanks, I'll try that debug option tomorrow when I'm back on the game.
As for the system update, I generally apt-update and upgrade so yes, it likely was updated since the previous version.
One interesting observation i had earlier when I was on, was that I ran a diff of my old server-settings.json (that I was still using) and the newest file, and saw I didn't have the following from the new file:
Code: Select all
"_comment_segment_sizes": "Long network messages are split into segments that are sent over multiple ticks. Their size depends on the number of peers currently connected. Increasing the segment size will increase upload bandwidth requirement for the server and download bandwidth requirement for clients. This setting only affects server outbound messages. Changing these settings can have a negative impact on connection stability for some clients.",
"minimum_segment_size": 25,
"minimum_segment_size_peer_count": 20,
"maximum_segment_size": 100,
"maximum_segment_size_peer_count": 10
I added that, restarted, and it seemed to run much better. I'm not sure if that's a coincidence, but probably noteworthy. Some friends are still on the server playing and are saying its been running good. I'll follow-up tomorrow.
Re: Server lag after updating to 0.17.x
Posted: Fri Jan 10, 2020 2:31 am
by rbit
Still getting massive lag

If anyone can help me troubleshoot it would be greatly appreciated.
Re: Server lag after updating to 0.17.x
Posted: Fri Jan 10, 2020 3:10 am
by Jap2.0
Just a note that the screenshot appears to be from the client and therefore if the server is causing the lag, it will be of little help. I'm not sure of the best way to get similar information from command line.
Re: Server lag after updating to 0.17.x
Posted: Sun Jan 12, 2020 4:34 pm
by rbit
Jap2.0 wrote: Fri Jan 10, 2020 3:10 am
Just a note that the screenshot appears to be from the client and therefore if the server is causing the lag, it will be of little help. I'm not sure of the best way to get similar information from command line.
I understood it was required just the same (to post the client screen).