As explained in this document which should also apply to global TCP load balancers, the time out of the backend service is not an idle or a keep alive timeout. It is a fixed time (default 30 seconds) that the backend service would wait for the backend instance(s) until it considers a request to have been failed.
On the other hand, the default TCP session timeout on a GCE instance is 10 minutes (600 seconds). Per this document, “ idle TCP connections are disconnected after 10 minutes. If your instance initiates or accepts long-lived connections with an external host, you can adjust TCP keep-alive settings to prevent these timeouts from dropping connections. You can configure the keep-alive settings on the Compute Engine instance, your external client, or both, depending on the host that typically initiates the connection. Set the keep-alives to less than 600 seconds to ensure that connections are refreshed before the timeout occurs.” To set keep-alive you may check this stackoverflow discussion. I hope this helps.
Hello Anand,As explained in this document which should also apply to global TCP load balancers, the time out of the backend service is not an idle or a keep alive timeout. It is a fixed time (default 30 seconds) that the backend service would wait for the backend instance(s) until it considers a request to have been failed.
Hello Anand,
Hello Anand,I'm Gerrit, a Solutions Engineer in Seattle. I work in GCP Support with Fady who asked me to provide a little bit of a more detailed explanation for you. I can clarify some of the concepts around timeouts with our global load balancer offerings. With that in mind, here goes...We have three global load balancer solutions, and all of them rely on a conceptual object called a backend service. (The Global HTTP(s) load balancer offering can use a backend storage bucket instead, but that's outside of the scope of this answer.) The three global load balancer offerings are:* Global HTTP(s) load balancer [1]* (Global) SSL Proxy load balancer [2]* (Global) TCP Proxy load balancer [3]Each of these types of load balancers acts as a proxy, terminating HTTP or TCP requests from clients at the load balancer, and creating new requests to send to backend instances. The backend service defines the backends and how they are to be used, and it also provides some logic for how to connect to them. Included with that logic is a concept of a backend service timeout [4].I understand that your question is directed to the TCP Proxy load balancer, but I think it will be easier to explain timeouts and retries if we start with the Global HTTP(S) load balancer and work backwards.For the Global HTTP(s) load balancer offering, the backend service timeout represents a response timeout; that is, the amount of time the load balancer will wait for a backend instance to send a response to a request. It's the time the load balancer will wait before giving up on the backend and synthesizing a HTTP 502 response. HTTP/1.1 connections are considered “alive” (persistent) by default [5], so the concept of a keepalive or idle timeout is separate. For the Global HTTP(s) load balancer, we have a fixed keepalive timeout of 600 seconds. The TCP session timeout is the keepalive timeout, not the response timeout, for HTTP.The two types of timeout - response and idle/keepalive - are unique to the HTTP protocol (due to [5]).The notion of a timeout becomes simpler outside of HTTP. For example, if the Global HTTP(s) load balancer is used to balance a WebSocket connection, response and idle/keepalive timeouts are not separate. For WebSockets, the backend service timeout still defines the response timeout, but that's the only timeout, so it is also the TCP session timeout. By “TCP session timeout,” we mean the maximum amount of time that a TCP session between the load balancer and a backend instance is allowed to remain open, whether or not the connection is active or idle. More detail for the WebSocket example is here [7].The same single timeout concept applies to the SSL Proxy and TCP Proxy load balancers. For both of these, the backend service timeout defines the response timeout, which is the TCP session timeout. This means that the the backend service timeout defines the maximum amount of time a TCP session can remain open between the load balancer and its backend instance, regardless of activity.
A special case is that idle connections can only persist for the duration of the backend service/response/TCP session timeout, but this timeout also applies to active connections for which the load balancer has not yet received a response. In your example where you're doing in-band health checks, I'm guessing you're sending data, getting a response, sending a health check, getting a response, etc. where all responses are returned within a period of time less than or equal to the backend service (response) timeout.
I realize there's a bit of subtlety here and that we could better state what we've documented for the backend service with respect to SSL and TCP Proxy load balancers [8].One other point I'll address is this: We're sometimes asked where the backend service fits in the OSI networking stack. It's best to think of the backend service as a collection of configuration parameters for our load balancers. For the three I've discussed, you might be using one to proxy HTTP or SSL traffic (application layer) or TCP traffic (layer four). The backend service object is also used by our non-proxy internal load balancer offering (which is outside the scope of this answer).Hopefully this helps you out!Sincerely,GerritCloud Solutions Engineer, Seattle
--
© 2017 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-discussion@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to a topic in the Google Groups "gce-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gce-discussion/MKKRv03d5i4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gce-discussion+unsubscribe@googlegroups.com.
To post to this group, send email to gce-discussion@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/360f60b0-c738-44d5-83fa-b1f7fbfeca61%40googlegroups.com.