[15.40] "Server is not responding" contiously while playing

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
Nico_995
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Feb 17, 2018 3:02 pm
Contact:

[15.40] "Server is not responding" contiously while playing

Post by Nico_995 »

Hello everyone,
i recently installed a headless factorio server on a dedicated machine. The problem I'm experiencing is a constant lag. The message "Server is not responding" keeps popping up.
The logs say a lot of "Invalid packet (type RequestForHeartbeatWhenDisconnecting) received", which, from what I've read online, basically means bad connection => lagging.

This is why I'm surprised that it is happening:
The server's hardware is more than enough to keep it running smoothly. Same for network resources. I get something like 300mbps up and down. Network latency between my pc (acts like a client for the game) and the serves is always around 40ms. The client network is not as fast as the server's but is around 10mbps of download which i think is enough to not stutter like that.

I will upload the current.log file and a bunch of screenshots to help for the debugging.

Thank you for your help! :D

EDIT: forgot to mention that i'm playing on a MAC, and to attach the savegame on which we are playing (which i won't upload until asked, due to the size)
Also, my friends don't get any issue and play just fine. I'm working on getting their debug-screenshot of the game.
screenshots
Attachments
factorio-current.log
server log file where you can find the "Invalid packet (type RequestForHeartbeatWhenDisconnecting) received"
(226.23 KiB) Downloaded 88 times
Nicola

Plawerth
Fast Inserter
Fast Inserter
Posts: 116
Joined: Thu Mar 02, 2017 12:57 am
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by Plawerth »

Where is the server in relation to you? Is it directly next to you, or is it "out in the cloud" in some datacenter far away? It sounds as though the server is in a distant datacenter, and you are accessing it remotely from a home connection, probably DSL.

If there are any background downloads or uploads to your Mac while playing, which are large enough to saturate the 10 megabit client connection, you will see "Server is not responding".

Upload speed could be the trouble as most home connections are multiple times faster for download vs upload. 10 down / 1 up is not uncommon.

,

Factorio exclusively uses UDP (user datagram protocol) packets for communication, while most normal web traffic and downloads use TCP (transmission control protocol) packets.

If a limited capacity network connection is being fully utilized by a combination of UDP and TCP packets, the UDP packets will be automatically discarded, to make room for the TCP packets.

This is a common problem for VOIP phones and videoconferencing, which both also use UDP for all data.

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by impetus maximus »

do you have more than one Ethernet/Wifi connection on your client machine?
this caused a similar problem for a player on my server.

if so, limit yourself to one.

Nico_995
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Feb 17, 2018 3:02 pm
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by Nico_995 »

impetus maximus wrote:do you have more than one Ethernet/Wifi connection on your client machine?
this caused a similar problem for a player on my server.

if so, limit yourself to one.
While I was having this issue, no other devices were actively connected to my home network. I even tried disconnecting them all, to aviod filling the bandwith with background updates and stuff like that, still noothing happened.
Nicola

Nico_995
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Feb 17, 2018 3:02 pm
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by Nico_995 »

Plawerth wrote:Where is the server in relation to you? Is it directly next to you, or is it "out in the cloud" in some datacenter far away? It sounds as though the server is in a distant datacenter, and you are accessing it remotely from a home connection, probably DSL.

If there are any background downloads or uploads to your Mac while playing, which are large enough to saturate the 10 megabit client connection, you will see "Server is not responding".

Upload speed could be the trouble as most home connections are multiple times faster for download vs upload. 10 down / 1 up is not uncommon.

,

Factorio exclusively uses UDP (user datagram protocol) packets for communication, while most normal web traffic and downloads use TCP (transmission control protocol) packets.

If a limited capacity network connection is being fully utilized by a combination of UDP and TCP packets, the UDP packets will be automatically discarded, to make room for the TCP packets.

This is a common problem for VOIP phones and videoconferencing, which both also use UDP for all data.
Thanks for your answer.
Yes, of course the server sits in a totally different AS, and there's a good chunk of level 3 in between (the traceroute detects 10 hops or so).
At this point I'm starting to think that the real problem is the way UDP traffic is managed by the ISP. A friend of mine, with a worse connection (much smaller ISP and lower speed) manage to play just fine, with maybe 30/40 ticks of latency. But then again, I'm the only one to have that kind of problem.

I will probably going to test the bandwith (with iperf maybe) and see how much packet loss there is (udp of course) between my home pc and the server.
If you are interested I can post the results here!
Nicola

Nico_995
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Feb 17, 2018 3:02 pm
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by Nico_995 »

Alright so, I made some test with iperf3 between client and server, udp mode.
The packet loss peaks out at over 70% sometimes (so bad :shock:) and the average final loss is something like 34%.
iperf-udp-server-side.txt
(5.21 KiB) Downloaded 108 times
iperf-udp-client-side.txt
(3.88 KiB) Downloaded 97 times
I will probably conduct some more tests later, over some other player's bandwith, and post the result here to compare with.

Meanwhile, if someone else has some ideas, feel free to jump in. Your help is really appreciated! :D
Nicola

Nico_995
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Feb 17, 2018 3:02 pm
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by Nico_995 »

[UPDATE]
I tweaked a bit with the UDP buffer size on both ends.
Now I'm not lagging anymore. Not sure which of the following is the reason:
-The actual local time: Sunday morning 11:00 AM -> might be that somehow the load on the network has dropped
-Change in the buffer size -> might be that the increased buffer size now (partially) avoids packet drops, and the connection is more stable

I will post again if the lag happens again, so that I won't spread a wrong solution.
Nicola

Nico_995
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Feb 17, 2018 3:02 pm
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by Nico_995 »

So I'm pretty much talking to myself, but I hope that this monologue will be useful for someone in the future.
Since we got to the point where we know for sure that the problem is the UDP packets being the 2 priority for all the nodes in between me and the server, I started looking for a workaround. What I thought of is some kind of tunnel.

What I did was to open a OVPN tunnel between me and the server. That way, the "factorio UDP packets" will always be encapsulated in the "VPN TCP packets". Of course I kind of doubled the packets headers, and thus added some overhead to the connection, but if I'm not mistaken (which could very well be), I'm ensuring that UDP packets get encapsulated over TCP/IP packets, removing the loss caused by "bad" managing of the UDP protocol.

So I think that's it for now! Thank you all, feel free to correct me, or ask me for any information about the problem anytime!
Nicola

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by impetus maximus »

over 70% packet loss :shock:

Nico_995
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Feb 17, 2018 3:02 pm
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by Nico_995 »

impetus maximus wrote:over 70% packet loss :shock:
Yeah that was my exact reaction, it is unbelieavable! The loss is 33% in average but still..
Nicola

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by impetus maximus »

Nico_995 wrote:
impetus maximus wrote:over 70% packet loss :shock:
Yeah that was my exact reaction, it is unbelieavable! The loss is 33% in average but still..
i would ping your default gateway of your ISP. the packet loss could be your connection to them.

[edit] sorry i'm tired

Nico_995
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Feb 17, 2018 3:02 pm
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by Nico_995 »

impetus maximus wrote:
Nico_995 wrote:
impetus maximus wrote:over 70% packet loss :shock:
Yeah that was my exact reaction, it is unbelieavable! The loss is 33% in average but still..
i would ping your default gateway of your ISP. the packet loss could be your connection to them.

[edit] sorry i'm tired
That's a good idea, but PING isn't always correct. I've experienced situations where, due to high load on the network, devices simply drop ICMP packets, resulting in poor ping performance.
Seeing how poorly my bandwith behaves, I wouldn't be surprised if there were problems between me and the ISP DG already.

Something that bothers me is that my friends play perfectly, despite their connection being even worse than mine :x and since I did all the set up.. this makes me even angrier :evil: :evil:
Nicola

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: [15.40] "Server is not responding" contiously while playing

Post by impetus maximus »

you shouldn't be seeing any packet loss to your default gateway. like 1 or less packets lost out of 1000

Post Reply

Return to “Technical Help”