That's ok thank you, I have asked the question via Azure portal.
TCP Connections dropped after approx 5 mins of inactivity
I have the idle timeout set to 20 minutes. However, tests with a Python TCP client talking to a a Python TCP server using "epoll", give me an issue when the idle time is roughly 5 minutes of inactivity. I loose the last packet sent, and get an error thrown from the client when after 10 minutes it tries to close the connection, as follows:-
Traceback (most recent call last):
File "atlas_client.py", line 121, in <module>
make_connection()
File "atlas_client.py", line 111, in make_connection
skt.shutdown(socket.SHUT_RDWR)
OSError: [Errno 107] Transport endpoint is not connected
Running this test locally on my Ubuntu VM, gives no such issue.
I am a bit of a loss as to what to try. I can (I believe) force keep-alive packets, however on a 4g connection when we are paying for each and every byte sent/received I don't really want to do this.
How can I tell whether this is an Azure firewall issue, Ubuntu VM or a problem with my code?
9 additional answers
Sort by: Most helpful
-
Cristian SPIRIDON 4,481 Reputation points
2020-11-05T22:55:35.793+00:00 I think this is because Azure firewall:
https://learn.microsoft.com/en-us/azure/firewall/firewall-faqCheck the paragraph for "TCP Idle Timeout".
Hope that help
-
Khurram Rahim 1,841 Reputation points
2020-11-06T20:14:12.443+00:00 https://serverfault.com/questions/981969/dropped-idle-connection-after-5-minutes
Please check mention link i hope it may help you
-
SaiKishor-MSFT 17,236 Reputation points
2020-11-06T07:12:25.507+00:00 A standard behavior of a network firewall is to ensure TCP connections are kept alive and to promptly close them if there's no activity. Azure Firewall TCP Idle Timeout is four minutes. This setting isn't configurable. If a period of inactivity is longer than the timeout value, there's no guarantee that the TCP or HTTP session is maintained.
A common practice is to use a TCP keep-alive. This practice keeps the connection active for a longer period. For more information, see the .NET examples. As given in the doc- https://learn.microsoft.com/en-us/azure/firewall/firewall-faqHope this helps. Please let us know if you need any further assistance. Thank you!
-
Mike Taylor 116 Reputation points
2020-11-06T09:27:01.707+00:00 Just so I understand...
So although the TCP idle timeout is set at 30 minutes (according to the IP configuration on Azure), the network firewall will close in-active sessions after 4 minutes of inactivity (where keep-alives haven't been set).
We have GPRS devices (which we have been using for years) that have no ability to set "keep-alives", can we set this server side (on the Azure VM) to keep the session active?