I am looking for ways to identify the default timeout configured on our container application. For this I was trying the nc command
The application is running on a GCP VM host with a public IP as a docker container . The port I am trying to probe does not exists so that I can find the timeout value for the application.
Probing the IP of the container shows below results
$ time nc -v 172.28.36.5 8546
nc: connect to 172.28.36.5 port 8546 (tcp) failed: Connection refused
real 0m0.005s
user 0m0.000s
sys 0m0.005s
$ time nc -v 34.91.145.25 8546
nc: connect to 34.91.145.25 port 8546 (tcp) failed: Connection timed out
real 2m10.123s
user 0m0.000s
sys 0m0.004s
How the timeout value is calculated as it is different for container ip and external ip of the host ?
My task is to increase the tcp timeout value of the container .
Is it determined by the following parameters ? But in that case it should have been greater than 10 minutes .
$ cat /proc/sys/net/ipv4/tcp_keepalive_time 7200
Any suggestions ?
It doesn't seem to be the correct way to identify the keep-alive time. You can check out how to identify timeout here.
To answer your second question, yes, TCP timeout is determined by
The default value of keep_alive_time is 7200 seconds (2 hours), which is greater than 10 minutes as expected.
For your first question, to increase the TCP timeout time, you can refer this page.